test/setup.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 23
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 23
rs 10
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 7 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
  mongoose.connect('mongodb://localhost/devise', (err) => {
15
    if (err) {
16
      throw err
17
    }
18
  })
19
})
20
21
after(() => {
22
  mongoose.connection.dropDatabase()
23
})
24