-
Notifications
You must be signed in to change notification settings - Fork 1
/
integ-test.mjs
42 lines (34 loc) · 1.1 KB
/
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
import validate_backend from '@phorbas/store/esm/node/validate_backend.mjs'
import {bkc_with_pouchdb} from '@phorbas/store/esm/node/pouchdb.mjs'
import {bkc_with_couchdb} from '@phorbas/store/esm/node/couchdb.mjs'
const PouchDB = require('pouchdb')
const nano_conn = require('nano')
const _host_list = [
'http://admin:please@some_couchdb_v2:5984',
'http://admin:please@some_couchdb_v3:5984',
]
for (const host of _host_list) {
validate_backend(
`${host} with PouchDB`,
async ctx =>
bkc_with_pouchdb(
new PouchDB(`${host}/pouchdb_phorbas_test`)) )
validate_backend(
`${host} with Nano CouchDB driver`,
async ctx =>
bkc_with_couchdb(
nano_conn(host),
{database: 'nano_phorbas_test'}) )
validate_backend(
`${host} with path and PouchDB`,
async ctx =>
bkc_with_pouchdb(
new PouchDB(`${host}/pouchdb_phorbas_test`),
{path:'/a/b/c'}) )
validate_backend(
`${host} with path and Nano CouchDB driver`,
async ctx =>
bkc_with_couchdb(
nano_conn(host),
{path:'/a/b/c', database: 'nano_phorbas_test'}) )
}