fixed bug in command.js
This commit is contained in:
@@ -45,7 +45,7 @@ class Command{
|
|||||||
//else return false
|
//else return false
|
||||||
if(splitMsg[i] == splitCommand[i]){
|
if(splitMsg[i] == splitCommand[i]){
|
||||||
continue;
|
continue;
|
||||||
}else if(splitCommand[i].match(/[<>]/g).length > 1){
|
}else if(splitCommand[i].match(/[<>]/g) != null){
|
||||||
continue;
|
continue;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
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', () => {
|
it('Test : equals() with spelling error', () => {
|
||||||
|
|
||||||
let message = 'wg websit';
|
let message = 'wg websit';
|
||||||
|
|||||||
Reference in New Issue
Block a user