]>
git.r.bdr.sh - rbdr/forum/blob - src/utils/resolve_after.test.js
1 import { resolveAfter
} from './resolve_after';
3 describe('Resolve After', () => {
5 test('it should throw if given 0', () => {
13 test('it should throw if given a negative number', () => {
21 test('it should throw if given a negative number', () => {
29 test('it should resolve after the specified number of times', () => {
33 const { counter
, resolveAfterThree
} = resolveAfter(3);
36 resolveAfterThree
.then(() => (resolved
= true));
38 expect(resolved
).toBe(false);
40 expect(resolved
).toBe(false);
42 expect(resolved
).toBe(true);