Total Complexity | 6 |
Complexity/F | 1.2 |
Lines of Code | 27 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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 |