]>
git.r.bdr.sh - rbdr/forum/blob - src/utils/resolve_after.test.js
f7fc75364d85542f4d12cf5f895e9c94784d683a
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);