How to use the traverse.deepEqual function in traverse

To help you get started, we’ve selected a few traverse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github substack / testling / browser / test_handle.js View on Github external
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();
};
github substack / testling / browser / test_handle.js View on Github external
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();
};