| Total Complexity | 6 |
| Complexity/F | 1 |
| Lines of Code | 40 |
| Function Count | 6 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | 'use strict' |
||
| 2 | |||
| 3 | const chai = require('chai') |
||
| 4 | const expect = chai.expect |
||
| 5 | |||
| 6 | const out = require('../src/out.js') |
||
| 7 | const baseFileDir = process.cwd() + '/spec' |
||
|
|
|||
| 8 | const fixtureInput = require('./fixtures/input.json') |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Test behavior |
||
| 12 | * |
||
| 13 | * 1. Test sourceConfiguration |
||
| 14 | * - source: url, password |
||
| 15 | * - params: payload, topic |
||
| 16 | * 2. Test to send payloads |
||
| 17 | * 3. Test callback to send status |
||
| 18 | */ |
||
| 19 | describe('out', () => { |
||
| 20 | |||
| 21 | beforeEach((done) => { |
||
| 22 | this.input = JSON.parse(JSON.stringify(fixtureInput)) |
||
| 23 | done() |
||
| 24 | }) |
||
| 25 | |||
| 26 | afterEach((done) => { |
||
| 27 | delete this.input |
||
| 28 | done() |
||
| 29 | }) |
||
| 30 | |||
| 31 | describe('out', () => { |
||
| 32 | it('should not throw an error', (done) => { |
||
| 33 | out(this.input, (error) => { |
||
| 34 | expect(error).to.not.exist |
||
| 35 | done() |
||
| 36 | }) |
||
| 37 | }) |
||
| 38 | |||
| 39 | }) |
||
| 40 | }) |
||
| 41 |