test/unit/price.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 16
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 16
rs 10
wmc 3
mnd 0
bc 3
fnc 3
bpm 1
cpm 1
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A price.js ➔ describe(ꞌUnit Test Price Modelꞌ) 0 10 1
1
'use strict'
2
var mongoose = require('mongoose')
3
var Price = mongoose.model('Price')
4
var chai = require('chai')
5
var expect = chai.expect
6
7
describe('Unit Test Price Model', function () {
8
  it('should be invalid if name is empty', function (done) {
9
    var price = new Price()
10
11
    price.validate(function (err) {
12
      expect(err.errors.name).to.exist
0 ignored issues
show
introduced by
The result of the property access to expect(err.errors.name).to.exist is not used.
Loading history...
13
      done()
14
    })
15
  })
16
})
17