Passed
Pull Request — master (#2)
by André
01:31
created

out.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
dl 0
loc 6
rs 10
nop 1
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'
0 ignored issues
show
Unused Code introduced by
The constant baseFileDir seems to be never used. Consider removing it.
Loading history...
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
0 ignored issues
show
introduced by
The result of the property access to expect(error).to.not.exist is not used.
Loading history...
35
				done()
36
			})
37
		})
38
39
	})
40
})
41