-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathtest-helper.js
More file actions
25 lines (23 loc) · 618 Bytes
/
test-helper.js
File metadata and controls
25 lines (23 loc) · 618 Bytes
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
'use strict'
const helper = require('../test-helper')
const Connection = require('../../../lib/connection')
const { Client } = helper
const makeClient = function (config) {
const connection = new Connection({ stream: 'no' })
connection.startup = function () {}
connection.connect = function () {}
connection.query = function (text) {
this.queries.push(text)
}
connection.queries = []
const client = new Client({ connection: connection, ...config })
client.connect()
client.connection.emit('connect')
return client
}
module.exports = Object.assign(
{
client: makeClient,
},
helper
)