diff --git a/test/integration/client/type-coercion-tests.js b/test/integration/client/type-coercion-tests.js index 8654d287..41127606 100644 --- a/test/integration/client/type-coercion-tests.js +++ b/test/integration/client/type-coercion-tests.js @@ -1,15 +1,13 @@ var helper = require(__dirname + '/test-helper'); - +var client = helper.client(); +client.on('drain', client.end.bind(client)); var testForTypeCoercion = function(type){ + client.query("create temp table test_type(col " + type.name + ")"); + test("Coerces " + type.name, function() { type.values.forEach(function(val) { - var client = helper.client(); - - client.query("create temp table test_type(col " + type.name + ")"); - client.on('drain', client.end.bind(client)); - var insertQuery = client.query({ name: 'insert type test ' + type.name, text: 'insert into test_type(col) VALUES($1)', @@ -30,6 +28,8 @@ var testForTypeCoercion = function(type){ text: 'delete from test_type' }); }); + + client.query('drop table test_type'); }); }; diff --git a/test/test-helper.js b/test/test-helper.js index b89d7c4d..7bbb424b 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -23,7 +23,7 @@ assert.emits = function(item, eventName, callback) { test("Should have called " + eventName, function() { assert.ok(called, "Expected '" + eventName + "' to be called.") }); - },1000); + },10000); item.once(eventName, function() { called = true;