Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Test.prototype.deepEqual = function (x, y, desc) {
this.count ++;
if (this.planned && this.count > this.planned) {
this.emit('fail', 'more tests run than planned');
}
else if (!this.running) {
this.emit('fail', 'deepEqual() called after test ended');
}
else if (traverse.deepEqual(x, y)) {
this.emit('ok', 'deepEqual', x, y, desc);
}
else {
this.emit('fail', 'deepEqual', x, y, desc);
}
if (this.planned && this.count === this.planned) this.end();
};
Test.prototype.notDeepEqual = function (x, y, desc) {
this.count ++;
if (this.planned && this.count > this.planned) {
this.emit('fail', 'more tests run than planned');
}
else if (!this.running) {
this.emit('fail', 'notDeepEqual() called after test ended');
}
else if (!traverse.deepEqual(x, y)) {
this.emit('ok', 'notDeepEqual', x, y, desc);
}
else {
this.emit('fail', 'notDeepEqual', x, y, desc);
}
if (this.planned && this.count === this.planned) this.end();
};