2017-01-11 15:11:34 -08:00
|
|
|
'use strict'
|
|
|
|
|
2017-05-26 08:15:54 -07:00
|
|
|
const
|
2018-03-04 15:09:18 -08:00
|
|
|
Interrupt = require('../src/interrupt'),
|
|
|
|
expect = require('chai').expect
|
2017-01-21 12:23:45 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
// TODO finish simple test of a pin as interrupt
|
2017-01-18 20:31:53 -08:00
|
|
|
|
2017-05-26 08:15:54 -07:00
|
|
|
describe(
|
2018-03-04 15:09:18 -08:00
|
|
|
'Testing ',
|
|
|
|
function () {
|
|
|
|
hooks()
|
|
|
|
interrupt()
|
|
|
|
someothertests()
|
|
|
|
})
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2017-05-26 08:15:54 -07:00
|
|
|
//****************** TESTS **********************
|
|
|
|
function interrupt() {
|
2018-03-04 15:09:18 -08:00
|
|
|
it('==> tests an interrupt', async function () {
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
expect(result, 'test failed').to.equal('expectedresult')
|
2017-01-11 15:11:34 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
})
|
2017-05-26 08:15:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function someothertests() {
|
2018-03-04 15:09:18 -08:00
|
|
|
it('==> test something', async function () {
|
2017-05-26 08:15:54 -07:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
let result = await someasyncfunction()
|
|
|
|
expect(result, 'test failed').to.equal('expectedresult')
|
|
|
|
await pause(1000)
|
2017-05-26 08:15:54 -07:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
})
|
2017-05-26 08:15:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function hooks() {
|
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
before(async() => {
|
2017-01-25 00:11:20 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
})
|
2017-01-25 11:41:00 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
beforeEach(async() => {})
|
2017-01-21 12:21:16 -08:00
|
|
|
|
2018-03-04 15:09:18 -08:00
|
|
|
after(async() => {})
|
2017-01-21 23:48:17 -08:00
|
|
|
|
|
|
|
}
|