uci-mqtt/test/amodule.test.js

52 lines
903 B
JavaScript
Raw Normal View History

2017-01-11 15:11:34 -08:00
'use strict'
const
Changeme = require('../src/changeme'),
expect = require('chai').expect,
pause = require('@uci/utils').pPause
2017-01-16 17:05:24 -08:00
describe(
`Testing `,
function () {
hooks()
sometests()
someothertests()
})
2017-01-11 15:11:34 -08:00
//****************** TESTS **********************
function sometests() {
it('==> test something', async function () {
2017-01-11 15:11:34 -08:00
let result = await someasyncfunction()
expect(result, `test failed`).to.equal('expectedresult')
await pause(1000)
2017-01-11 15:11:34 -08:00
})
}
function someothertests() {
it('==> test something', async function () {
let result = await someasyncfunction()
expect(result, `test failed`).to.equal('expectedresult')
await pause(1000)
})
}
function hooks() {
before(async() => {
await someasyncfunctiontodobefore()
})
beforeEach(async() => {
await someasyncfunctiontodobeforeeachtest()
})
after(async() => {
await someasyncfunctiontodoaftereeachtest()
})
}