add some tests for normalizeQueryConfig
This commit is contained in:
parent
5a91dd0c35
commit
5d25bcdcf0
@ -163,3 +163,23 @@ test('types are exported', function() {
|
|||||||
var pg = require(__dirname + '/../../lib/index');
|
var pg = require(__dirname + '/../../lib/index');
|
||||||
assert.ok(pg.types);
|
assert.ok(pg.types);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('normalizing query configs', function() {
|
||||||
|
var config
|
||||||
|
var callback = function () {}
|
||||||
|
|
||||||
|
config = utils.normalizeQueryConfig({text: 'TEXT'})
|
||||||
|
assert.same(config, {text: 'TEXT'})
|
||||||
|
|
||||||
|
config = utils.normalizeQueryConfig({text: 'TEXT'}, [10])
|
||||||
|
assert.deepEqual(config, {text: 'TEXT', values: [10]})
|
||||||
|
|
||||||
|
config = utils.normalizeQueryConfig({text: 'TEXT', values: [10]})
|
||||||
|
assert.deepEqual(config, {text: 'TEXT', values: [10]})
|
||||||
|
|
||||||
|
config = utils.normalizeQueryConfig('TEXT', [10], callback)
|
||||||
|
assert.deepEqual(config, {text: 'TEXT', values: [10], callback: callback})
|
||||||
|
|
||||||
|
config = utils.normalizeQueryConfig({text: 'TEXT', values: [10]}, callback)
|
||||||
|
assert.deepEqual(config, {text: 'TEXT', values: [10], callback: callback})
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user