mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
22 lines
561 B
JavaScript
22 lines
561 B
JavaScript
'use strict'
|
|
const assert = require('assert')
|
|
const Client = require('../../lib/client')
|
|
const NativeClient = require('../../lib/native')
|
|
|
|
const client = new Client()
|
|
const nativeClient = new NativeClient()
|
|
|
|
client.connect()
|
|
nativeClient.connect((err) => {
|
|
client.query('SELECT alsdkfj', (err) => {
|
|
client.end()
|
|
|
|
nativeClient.query('SELECT lkdasjfasd', (nativeErr) => {
|
|
for (const key in nativeErr) {
|
|
assert.equal(err[key], nativeErr[key], `Expected err.${key} to equal nativeErr.${key}`)
|
|
}
|
|
nativeClient.end()
|
|
})
|
|
})
|
|
})
|