uci-interrupt/test/interrupt.test.js

37 lines
867 B
JavaScript
Raw Normal View History

2017-01-11 15:11:34 -08:00
'use strict'
2017-01-21 12:23:45 -08:00
// const expect = require('chai').expect
const Interrupt = require('../').Interrupt
2017-01-11 15:11:34 -08:00
//time-stamp for use when watching to distinguish reruns in console
// place in alpha first file only
let date = new Date(Date.now())
console.log(date.getMinutes(), "\:", date.getSeconds())
2017-01-21 12:21:16 -08:00
let inter17 = new Interrupt(17, { hook: 'a hook to something to do' })
2017-01-11 15:11:34 -08:00
2017-01-21 12:21:16 -08:00
// console.log('inter17', inter17)
2017-01-11 15:11:34 -08:00
2017-01-21 12:21:16 -08:00
inter17.on('fired', hook => {
console.log('Listener fired and returned:', hook)
2017-01-11 15:11:34 -08:00
})
2017-01-21 12:21:16 -08:00
inter17.init()
.then((resp) => {
console.log('return from init()', resp)
2017-01-21 12:23:45 -08:00
// setInterval(function () {
// inter17.fire()
// }, 1000)
2017-01-21 12:21:16 -08:00
})
2017-01-21 12:23:45 -08:00
.catch(err => console.log("returned error:", err))
2017-01-21 12:21:16 -08:00
// describe('Interrupt Class', function () {
//
// it('can be manually fired', function () {
// expect(hello('Forest Gump')).to.equal()
// })
//
// })
// })