@@ -8,7 +8,10 @@ import sinon from 'sinon'
8
8
import { expect } from 'chai'
9
9
import { join } from 'path'
10
10
11
- import { Database } from '../../src'
11
+ import {
12
+ Database ,
13
+ PopApi
14
+ } from '../../src'
12
15
import { name } from '../../package'
13
16
14
17
/** @test {Database} */
@@ -56,7 +59,7 @@ describe('Database', () => {
56
59
] )
57
60
mkdirp . sync ( logDir )
58
61
59
- database = new Database ( { } , {
62
+ database = new Database ( PopApi , {
60
63
database : name ,
61
64
username : '' ,
62
65
password : ''
@@ -67,18 +70,18 @@ describe('Database', () => {
67
70
it ( 'should test the use the environment variables to connect' , ( ) => {
68
71
const stub = process . env . MONGO_PORT_27017_TCP_ADDR
69
72
process . env . MONGO_PORT_27017_TCP_ADDR = 'localhost'
70
- new Database ( { } , { // eslint-disable-line no-new
73
+ new Database ( PopApi , { // eslint-disable-line no-new
71
74
database : name
72
75
} )
73
76
74
77
process . env . MONGO_PORT_27017_TCP_ADDR = null
75
- new Database ( { } , { // eslint-disable-line no-new
78
+ new Database ( PopApi , { // eslint-disable-line no-new
76
79
database : name
77
80
} )
78
81
process . env . MONGO_PORT_27017_TCP_ADDR = stub
79
82
80
83
try {
81
- new Database ( { } , { } ) // eslint-disable-line no-new
84
+ new Database ( PopApi , { } ) // eslint-disable-line no-new
82
85
expect ( true ) . to . be . false
83
86
} catch ( err ) {
84
87
expect ( err ) . to . be . an ( 'Error' )
@@ -113,7 +116,7 @@ describe('Database', () => {
113
116
expect ( mongoose . connection . readyState ) . to . equal ( 0 )
114
117
115
118
try {
116
- new Database ( { } , { // eslint-disable-line no-new
119
+ new Database ( PopApi , { // eslint-disable-line no-new
117
120
database : name
118
121
} )
119
122
process . env . NODE_ENV = 'test'
@@ -165,7 +168,7 @@ describe('Database', () => {
165
168
expect ( mongoose . connection . readyState ) . to . be . a ( 'number' )
166
169
expect ( mongoose . connection . readyState ) . to . equal ( 0 )
167
170
168
- const database = new Database ( { } , {
171
+ const database = new Database ( PopApi , {
169
172
database : name ,
170
173
username : 'fault' ,
171
174
password : 'faulty'
0 commit comments