node-postgres/test/integration/test-helper.js
Brian C 8798e50ad3 Re-enable eslint with standard format (#1367)
* Work on converting lib to standard

* Finish updating lib

* Finish linting lib

* Format test files

* Add .eslintrc with standard format

* Supply full path to eslint bin

* Move lint command to package.json

* Add eslint as dev dependency
2017-07-15 12:05:58 -05:00

28 lines
705 B
JavaScript

'use strict'
var helper = require('./../test-helper')
if (helper.args.native) {
Client = require('./../../lib/native')
helper.Client = Client
helper.pg = helper.pg.native
}
// creates a client from cli parameters
helper.client = function (cb) {
var client = new Client()
client.connect(cb)
return client
}
var semver = require('semver')
helper.versionGTE = function (client, versionString, callback) {
client.query('SELECT version()', assert.calls(function (err, result) {
if (err) return callback(err)
var version = result.rows[0].version.split(' ')[1]
return callback(null, semver.gte(version, versionString))
}))
}
// export parent helper stuffs
module.exports = helper