fix(core): update

This commit is contained in:
2021-06-04 14:11:27 +02:00
parent 2dc91dc2f0
commit 5df94778dd
6 changed files with 54 additions and 25 deletions

View File

@ -2,7 +2,7 @@ import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdelay from '../ts/index';
tap.test('.delayFor should delay async', async tools => {
tap.test('.delayFor should delay async', async (tools) => {
tools.timeout(5000);
let timePassed = false;
setTimeout(() => {
@ -14,7 +14,7 @@ tap.test('.delayFor should delay async', async tools => {
});
});
tap.test('.delayForRandom should delay async for a random time period', async tools => {
tap.test('.delayForRandom should delay async for a random time period', async (tools) => {
let timePassedBefore = false;
let timePassedAfter = false;
setTimeout(() => {
@ -28,14 +28,14 @@ tap.test('.delayForRandom should delay async for a random time period', async to
expect(timePassedAfter).to.be.false;
});
tap.test('.delayFor should pass on a type', async tools => {
tap.test('.delayFor should pass on a type', async (tools) => {
tools.timeout(5000);
let timePassed = false;
setTimeout(() => {
timePassed = true;
}, 2000);
let hey = 'heyThere';
await smartdelay.delayFor<string>(3000, hey).then(async stringArg => {
await smartdelay.delayFor<string>(3000, hey).then(async (stringArg) => {
expect(stringArg).equal('heyThere');
});
});
@ -45,7 +45,7 @@ tap.test('smartdelay.Timeout', async () => {
await timeout.promise;
});
tap.test('smartdelay.Timeout should cancel', async tools => {
tap.test('smartdelay.Timeout should cancel', async (tools) => {
let timeout = new smartdelay.Timeout(60000);
timeout.cancel();
});