2018-04-05 15:50:39 -07:00
|
|
|
import aClass from '../src'
|
|
|
|
import chai from 'chai'
|
|
|
|
import chaiAsPromised from 'chai-as-promised'
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
chai.use(chaiAsPromised)
|
|
|
|
const expect = chai.expect
|
2017-01-16 17:05:24 -08:00
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
describe(
|
2018-04-05 15:50:39 -07:00
|
|
|
'Testing ',
|
|
|
|
function () {
|
|
|
|
hooks()
|
|
|
|
sometests()
|
|
|
|
someothertests()
|
|
|
|
})
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2017-05-29 10:00:12 -07:00
|
|
|
//****************** TESTS **********************
|
|
|
|
function sometests() {
|
2018-04-05 15:50:39 -07:00
|
|
|
it('==> test something', async function () {
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
let result = await someasyncfunction()
|
|
|
|
expect(result, 'test failed').to.equal('expectedresult')
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
})
|
2017-05-29 10:00:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function someothertests() {
|
2018-04-05 15:50:39 -07:00
|
|
|
it('==> test something', async function () {
|
2017-05-29 10:00:12 -07:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
let result = await someasyncfunction()
|
|
|
|
expect(result, 'test failed').to.equal('expectedresult')
|
2017-05-29 10:00:12 -07:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
})
|
2017-05-29 10:00:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function hooks() {
|
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
before(async() => {
|
|
|
|
await someasyncfunctiontodobefore()
|
|
|
|
})
|
2017-05-29 10:00:12 -07:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
beforeEach(async() => {
|
|
|
|
await someasyncfunctiontodobeforeeachtest()
|
|
|
|
})
|
2017-05-29 10:00:12 -07:00
|
|
|
|
2018-04-05 15:50:39 -07:00
|
|
|
after(async() => {
|
|
|
|
await someasyncfunctiontodoaftereeachtest()
|
|
|
|
})
|
2017-05-29 10:00:12 -07:00
|
|
|
|
|
|
|
}
|