-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy path981-tests.js
38 lines (30 loc) · 901 Bytes
/
981-tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
var helper = require('./../test-helper');
//native bindings are only installed for native tests
if (!helper.args.native) {
return;
}
var assert = require('assert')
var pg = require('../../../lib')
var native = require('../../../lib').native
var JsClient = require('../../../lib/client')
var NativeClient = require('../../../lib/native')
assert(pg.Client === JsClient);
assert(native.Client === NativeClient);
const jsPool = new pg.Pool()
const nativePool = new native.Pool()
const suite = new helper.Suite()
suite.test('js pool returns js client', cb => {
jsPool.connect(function (err, client, done) {
assert(client instanceof JsClient);
done()
jsPool.end(cb)
})
})
suite.test('native pool returns native client', cb => {
nativePool.connect(function (err, client, done) {
assert(client instanceof NativeClient);
done()
nativePool.end(cb)
});
})