Skip to content

Commit 7b92f01

Browse files
committed
✨ Add test to commands
1 parent c97cf75 commit 7b92f01

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/components/commands/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function get(msg) {
2+
const cmds = {
3+
"!invite": 'https://discord.gg/kYBtYPj',
4+
"!azurePipelines": 'https://azure.microsoft.com/pt-br/services/devops/pipelines/',
5+
"!youtube": 'https://youtube.com/collabcode',
6+
};
7+
8+
return cmds[msg];
9+
}
10+
11+
export default {
12+
get
13+
}

test/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import commands from '../src/components/commands'
2+
3+
describe('#Commands', () => {
4+
describe('get()', () => {
5+
it('should return discord link when send !invite', () => {
6+
expect(commands.get('!invite')).toEqual('https://discord.gg/kYBtYPj')
7+
})
8+
})
9+
})

0 commit comments

Comments
 (0)