update to latest standards

This commit is contained in:
2017-04-09 12:35:53 +02:00
parent c9fd889dd3
commit 43bc078ace
15 changed files with 2958 additions and 193 deletions

1
test/test.d.ts vendored
View File

@ -1 +0,0 @@
import 'typings-test';

View File

@ -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)
})
})