/
integ-test.mjs
47 lines (39 loc) · 1003 Bytes
/
integ-test.mjs
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
39
40
41
42
43
44
45
46
import {validate_backend, validate_immutable} from '@phorbas/store/esm/node/validate_backend.mjs'
import bkc_with_knex from '@phorbas/store/esm/node/knex.mjs'
import knex from 'knex'
const mssql_hosts = [
'mssql_latest',
'mssql_2019',
'mssql_2017',
]
for (const host of mssql_hosts) {
validate_backend(
`${host} with knex`,
{
create: ctx =>
bkc_with_knex(
ctx.kdb = knex({
client: 'mssql',
connection: {
host,
user: 'sa',
password: 'integ_pass',
}}) ),
done: ctx => ctx.kdb.destroy(),
})
validate_immutable(
`${host} with knex (immutable)`,
{
create: ctx =>
bkc_with_knex(
ctx.kdb = knex({
client: 'mssql',
connection: {
host,
user: 'sa',
password: 'integ_pass',
}}),
{immutable: true}),
done: ctx => ctx.kdb.destroy(),
})
}