BREAKING CHANGE(core): update

This commit is contained in:
2023-04-05 16:29:29 +02:00
parent 9f305070eb
commit 1f0e574854
11 changed files with 4529 additions and 25481 deletions

View File

@ -1,6 +1,6 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartdelay from '../ts/index';
import * as smartdelay from '../ts/index.js';
tap.test('.delayFor should delay async', async (tools) => {
tools.timeout(5000);
@ -10,7 +10,7 @@ tap.test('.delayFor should delay async', async (tools) => {
}, 2000);
await smartdelay.delayFor(3000).then(async () => {
// tslint:disable-next-line:no-unused-expression
expect(timePassed).to.be.true;
expect(timePassed).toBeTrue();
});
});
@ -24,8 +24,8 @@ tap.test('.delayForRandom should delay async for a random time period', async (t
timePassedAfter = true;
}, 5000);
await smartdelay.delayForRandom(3000, 4900);
expect(timePassedBefore).to.be.true;
expect(timePassedAfter).to.be.false;
expect(timePassedBefore).toBeTrue();
expect(timePassedAfter).toBeFalse();
});
tap.test('.delayFor should pass on a type', async (tools) => {
@ -36,7 +36,7 @@ tap.test('.delayFor should pass on a type', async (tools) => {
}, 2000);
let hey = 'heyThere';
await smartdelay.delayFor<string>(3000, hey).then(async (stringArg) => {
expect(stringArg).equal('heyThere');
expect(stringArg).toEqual('heyThere');
});
});