Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
testBindParameters: function () {
// TODO
var parsed;
parsed = parseQuery('in(id,$1)', [['a','b','c']]);
assert.strictEqual(JSON.stringify(parsed), JSON.stringify({
name: 'and',
args: [{ name: 'in', args: [ 'id', [ 'a', 'b', 'c' ]]}],
cache: {}
}));
parsed = parseQuery('eq(id,$1)', [ 'a' ]);
assert.deepEqual(JSON.stringify(parsed), JSON.stringify({
name: 'and',
args: [{ name: 'eq', args: ['id', 'a']}],
cache: {id: 'a'}
}));
},
delete actual.cache;
}
if (typeof expected === 'string') {
expected = parseQuery(expected);
}
if (!hasKeys(expected.cache)) {
delete expected.cache;
}
// someone decided that matching constructors is necessary for deep equality
// see https://github.com/theintern/intern/issues/284
// the deepEqual assertion also fails due to properties like toString so this assertion seems to
// be the most suitable.
assert.strictEqual(JSON.stringify(actual), JSON.stringify(expected));
};
};
testBindParameters: function () {
// TODO
var parsed;
parsed = parseQuery('in(id,$1)', [['a','b','c']]);
assert.strictEqual(JSON.stringify(parsed), JSON.stringify({
name: 'and',
args: [{ name: 'in', args: [ 'id', [ 'a', 'b', 'c' ]]}],
cache: {}
}));
parsed = parseQuery('eq(id,$1)', [ 'a' ]);
assert.deepEqual(JSON.stringify(parsed), JSON.stringify({
name: 'and',
args: [{ name: 'eq', args: ['id', 'a']}],
cache: {id: 'a'}
}));
},