fixed bug in command.js

This commit is contained in:
Mohammed Ashab Uddin
2020-07-25 21:19:59 +04:00
parent 90a14a9e1b
commit 416deb477c
2 changed files with 16 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ class Command{
//else return false
if(splitMsg[i] == splitCommand[i]){
continue;
}else if(splitCommand[i].match(/[<>]/g).length > 1){
}else if(splitCommand[i].match(/[<>]/g) != null){
continue;
}else{
return false;

View File

@@ -91,6 +91,21 @@ describe('Command', () => {
});
it('Test : equals() with different message', () => {
let message = 'wg website p12';
let a = new Command({
command: "wg create <id>",
callback: () => {
}
});
expect(a.equals(message)).to.false;
});
it('Test : equals() with spelling error', () => {
let message = 'wg websit';