Skip to content

Commit fa16966

Browse files
committed
add failing test that shows the issue
1 parent 5a2d01c commit fa16966

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/unit/utils-tests.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,14 @@ test('prepareValue: objects with circular toPostgres rejected', function() {
171171
}
172172
throw new Error("Expected prepareValue to throw exception");
173173
});
174+
175+
test('prepareValue: can safely be used to map an array of values including those with toPostgres functions', function() {
176+
var customType = {
177+
toPostgres: function() {
178+
return "zomgcustom!";
179+
}
180+
};
181+
var values = [1, "test", customType]
182+
var out = values.map(utils.prepareValue)
183+
assert.deepEqual(out, [1, "test", "zomgcustom!"])
184+
})

0 commit comments

Comments
 (0)