smartbrowser/test/test.ts
2016-09-19 20:00:19 +02:00

35 lines
1.0 KiB
TypeScript

import 'typings-test'
import * as should from 'should'
import * as smartbrowser from '../dist/index'
let testSmartBrowser: smartbrowser.Smartbrowser
describe('smartbrowser', () => {
it('should instanstiate a new browser ', function () {
testSmartBrowser = new smartbrowser.Smartbrowser({
webroot: './test/assets/',
watchFiles: ['./test/assets/']
})
should(testSmartBrowser).be.instanceof(smartbrowser.Smartbrowser)
})
it('should start the browser ', function (done) {
testSmartBrowser.start().then((bsInstance) => {
done()
}).catch((err) => { console.log(err) })
})
it('should stop the browser ', function (done) {
this.timeout(10000)
setTimeout(() => {
testSmartBrowser.stop().then(() => {
done()
}).catch((err) => { console.log(err) })
}, 2000)
})
it('should exit correctly',function(){
setTimeout(() => {
process.exit(0)
},2000)
})
})