2017-01-11 15:11:34 -08:00
|
|
|
'use strict'
|
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
const
|
|
|
|
Changeme = require('../src/changeme'),
|
|
|
|
expect = require('chai').expect,
|
|
|
|
pause = require('@uci/utils').pPause
|
2017-01-16 17:05:24 -08:00
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
describe(
|
|
|
|
`Testing `,
|
|
|
|
function () {
|
|
|
|
hooks()
|
|
|
|
sometests()
|
|
|
|
someothertests()
|
|
|
|
})
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
//****************** TESTS **********************
|
|
|
|
function sometests() {
|
|
|
|
it('==> test something', async function () {
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
let result = await someasyncfunction()
|
|
|
|
expect(result, `test failed`).to.equal('expectedresult')
|
|
|
|
await pause(1000)
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2017-05-29 10:00:12 -07: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()
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|