fixed bug in command.js
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user