Skip to content

Commit e57e180

Browse files
author
bmc
committed
no-data test passing
1 parent 8108736 commit e57e180

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var helper = require(__dirname + '/test-helper');
22

33
test("noData message handling", function() {
4-
return false;
4+
55
var client = helper.client();
66

77
client.query({
@@ -19,22 +19,17 @@ test("noData message handling", function() {
1919
name: 'insert',
2020
values: [101]
2121
});
22-
23-
client.connection.on('message', console.log);
24-
25-
var x = client.query({
22+
23+
var query = client.query({
2624
name: 'fetch',
27-
text: 'select size from boom'
25+
text: 'select size from boom where size < $1',
26+
values: [101]
2827
});
2928

30-
assert.raises(x, 'row', function(row) {
31-
assert.equal(row.fields[0], 100);
32-
33-
assert.raises(x, 'row', function(row) {
34-
assert.equal(row.fields[0], 101);
35-
});
29+
assert.raises(query, 'row', function(row) {
30+
assert.strictEqual(row.fields[0],100)
3631
});
37-
38-
x.on('end', query.end());
32+
33+
client.on('drain', client.end.bind(client));
3934

4035
});

0 commit comments

Comments
 (0)