add implementation

This commit is contained in:
2017-01-16 14:54:08 +01:00
parent 48efa9186c
commit df2fd32f9f
9 changed files with 119 additions and 1 deletions

31
test/test.ts Normal file
View File

@ -0,0 +1,31 @@
import 'typings-test'
import * as should from 'should'
import * as smartdelay from '../dist/index'
describe('smartdelay', function () {
it('.delayFor should delay async', function(done) {
this.timeout(5000)
let timePassed = false
setTimeout(() => {
timePassed = true
},2000)
smartdelay.delayFor(3000).then(() => {
should(timePassed).be.true()
done()
})
})
it('.delayFor should pass on a type', function(done) {
this.timeout(5000)
let timePassed = false
setTimeout(() => {
timePassed = true
},2000)
let hey = 'heyThere'
smartdelay.delayFor<string>(3000, hey).then((stringArg) => {
should(stringArg).equal('heyThere')
done()
})
})
})