Brian C 50c06f9bc6
Remove test globals (#3264)
* Remove assert from globals

* Remove Client from globals

* Remove global test function

* Remove MemoryStream from globals

* Require assert in SASL integration tests

* Attempt to use a postgres with ssl?

* Use latest image

* Remove connection tests - they test internals that are better covered by testint the client
2024-06-19 13:46:16 -05:00

25 lines
631 B
JavaScript

'use strict'
var helper = require('../test-helper')
var client = helper.client()
const assert = require('assert')
client.query('CREATE TEMP TABLE arrtest (n integer, s varchar)')
client.query("INSERT INTO arrtest VALUES (4, 'foo'), (5, 'bar'), (6, 'baz');")
var qText =
"SELECT \
ARRAY[1, 2, 3] AS b,\
ARRAY['xx', 'yy', 'zz'] AS c,\
ARRAY(SELECT n FROM arrtest) AS d,\
ARRAY(SELECT s FROM arrtest) AS e;"
client.query(qText, function (err, result) {
if (err) throw err
var row = result.rows[0]
for (var key in row) {
assert.equal(typeof row[key], 'object')
assert.equal(row[key].length, 3)
}
client.end()
})