add failing test that shows the issue
This commit is contained in:
parent
5a2d01ccd0
commit
fa16966f91
@ -171,3 +171,14 @@ test('prepareValue: objects with circular toPostgres rejected', function() {
|
||||
}
|
||||
throw new Error("Expected prepareValue to throw exception");
|
||||
});
|
||||
|
||||
test('prepareValue: can safely be used to map an array of values including those with toPostgres functions', function() {
|
||||
var customType = {
|
||||
toPostgres: function() {
|
||||
return "zomgcustom!";
|
||||
}
|
||||
};
|
||||
var values = [1, "test", customType]
|
||||
var out = values.map(utils.prepareValue)
|
||||
assert.deepEqual(out, [1, "test", "zomgcustom!"])
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user