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 resolve after the specified number of times', () => {
25 const { counter, promise: resolveAfterThree } = resolveAfter(3);
28 resolveAfterThree.then(() => (resolved = true));
30 expect(resolved).toBe(false);
32 expect(resolved).toBe(false);
34 expect(resolved).toBe(true);