File tree 2 files changed +23
-1
lines changed
test/integration/gh-issues
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ var Result = function (rowMode, types) {
17
17
this . rowCount = null
18
18
this . oid = null
19
19
this . rows = [ ]
20
- this . fields = undefined
20
+ this . fields = [ ]
21
21
this . _parsers = undefined
22
22
this . _types = types
23
23
this . RowCtor = null
Original file line number Diff line number Diff line change
1
+
2
+ "use strict"
3
+ var helper = require ( './../test-helper' )
4
+ var assert = require ( 'assert' )
5
+
6
+ const suite = new helper . Suite ( )
7
+
8
+ suite . test ( 'All queries should return a result array' , ( done ) => {
9
+ const client = new helper . pg . Client ( )
10
+ client . connect ( )
11
+ const promises = [ ]
12
+ promises . push ( client . query ( 'CREATE TEMP TABLE foo(bar TEXT)' ) )
13
+ promises . push ( client . query ( 'INSERT INTO foo(bar) VALUES($1)' , [ 'qux' ] ) )
14
+ promises . push ( client . query ( 'SELECT * FROM foo WHERE bar = $1' , [ 'foo' ] ) )
15
+ Promise . all ( promises ) . then ( results => {
16
+ results . forEach ( res => {
17
+ assert ( Array . isArray ( res . fields ) )
18
+ assert ( Array . isArray ( res . rows ) )
19
+ } )
20
+ client . end ( done )
21
+ } )
22
+ } )
You can’t perform that action at this time.
0 commit comments