src/helpers/endpoints/all.spec.js   A
last analyzed

Complexity

Total Complexity 6
Complexity/F 1.2

Size

Lines of Code 27
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 6
c 1
b 0
f 0
nc 1
mnd 1
bc 6
fnc 5
dl 0
loc 27
rs 10
bpm 1.2
cpm 1.2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A all.spec.js ➔ ??? 0 1 1
1
'use strict'
2
3
import { describe, it } from 'mocha'
4
import { expect } from 'chai'
5
import restify from 'restify'
6
import endpoints from '.'
7
8
const server = restify.createServer()
9
server.get('/hello/:name', (req, res, next) => next())
10
11
/* eslint-disable no-undef */
12
describe('endpoints: helpers', () => {
13
  context('.all', () => {
14
    it('Should throw exception if server is not provided', () => {
15
      try {
16
        endpoints.listAll()
17
      } catch (error) {
18
        expect(error.code).to.be.equal('ERR_ASSERTION')
19
      }
20
    })
21
    it('Should not return empty', () => {
22
      const output = endpoints.listAll(server)
23
      expect(output).to.be.not.undefined()
24
      expect(output).to.be.not.null()
25
    })
26
  })
27
})
28