update to latest standards
This commit is contained in:
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
||||
import 'typings-test';
|
53
test/test.ts
53
test/test.ts
@ -1,34 +1,29 @@
|
||||
import 'typings-test'
|
||||
import * as should from 'should'
|
||||
import { tap, expect } from 'tapbundle'
|
||||
import * as smartdelay from 'smartdelay'
|
||||
|
||||
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)
|
||||
})
|
||||
|
||||
tap.test('should instanstiate a new browser ', async () => {
|
||||
testSmartBrowser = new smartbrowser.Smartbrowser({
|
||||
webroot: './test/assets/',
|
||||
watchFiles: [ './test/assets/' ]
|
||||
})
|
||||
return expect(testSmartBrowser).to.be.instanceof(smartbrowser.Smartbrowser)
|
||||
}).catch(tap.threw)
|
||||
|
||||
tap.test('should start the browser ', async () => {
|
||||
return await expect(testSmartBrowser.start()).to.eventually.be.fulfilled
|
||||
}).catch(tap.threw)
|
||||
|
||||
tap.test('should stop the browser ', async () => {
|
||||
return await smartdelay.delayFor(2000).then(() => {
|
||||
return expect(testSmartBrowser.stop()).to.eventually.be.fulfilled
|
||||
})
|
||||
})
|
||||
tap.test('should exit correctly', async () => {
|
||||
smartdelay.delayFor(2000).then(() => {
|
||||
process.exit(0)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user