test/unit/invoice.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 20
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
c 2
b 0
f 0
nc 1
dl 0
loc 20
rs 10
wmc 3
mnd 0
bc 3
fnc 3
bpm 1
cpm 1
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A invoice.js ➔ describe(ꞌUnit Test Invoice Modelꞌ) 0 13 1
1
'use strict'
2
var mongoose = require('mongoose')
3
var Customer = mongoose.model('Customer')
4
var Invoice = mongoose.model('Invoice')
5
var chai = require('chai')
6
var expect = chai.expect
7
8
describe('Unit Test Invoice Model', function () {
9
  it('should be valid with minimal data', function (done) {
10
    var invoice = new Invoice({
11
      customer: new Customer({name: 'Neil Grogan'}),
12
      items: [{ desc: 'Boiler Service and Repair', total: 80.00 }]
13
    })
14
15
    invoice.validate(function (err) {
16
      expect(err).to.not.exist
0 ignored issues
show
introduced by
The result of the property access to expect(err).to.not.exist is not used.
Loading history...
17
      done()
18
    })
19
  })
20
})
21