fixed bug in command.js

This commit is contained in:
Mohammed Ashab Uddin
2020-07-25 21:17:11 +04:00
parent 0b0569b783
commit d4be542a91
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.only('Test : equals() with different message', () => {
let message = 'wg website web';
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';