add implementation
This commit is contained in:
31
test/test.ts
Normal file
31
test/test.ts
Normal 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()
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user