test/setup.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 26
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
eloc 16
nc 1
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 4
mnd 1
bc 4
fnc 3
bpm 1.3333
cpm 1.3333
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A setup.js ➔ ??? 0 10 1
1
'use strict'
2
3
import mongoose from 'mongoose'
4
import chai from 'chai'
5
import chaiHttp from 'chai-http'
6
import dirtyChai from 'dirty-chai'
7
import { before, after } from 'mocha'
8
9
chai.use(chaiHttp)
10
chai.use(dirtyChai)
11
12
// prepares a clean bank
13
before(() => {
14
  const options = {
15
    useNewUrlParser: true
16
  }
17
  mongoose.connect('mongodb://localhost/devise', options, (err) => {
18
    if (err) {
19
      throw err
20
    }
21
  })
22
})
23
24
after(() => {
25
  mongoose.connection.dropDatabase()
26
})
27