aboutsummaryrefslogtreecommitdiff
path: root/src/lib/utils/resolve_after.test.ts
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2022-05-01 01:02:58 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2022-05-01 01:02:58 +0200
commitcac85db02ff00732cf75d473dc3411332f33d845 (patch)
tree5f244968a905eb3888434b3f60cbf05d2b652207 /src/lib/utils/resolve_after.test.ts
parenta7cf03c192470cbab13edeb1aec99e0c66dede10 (diff)
Apply formatting
Diffstat (limited to 'src/lib/utils/resolve_after.test.ts')
-rw-r--r--src/lib/utils/resolve_after.test.ts53
1 files changed, 23 insertions, 30 deletions
diff --git a/src/lib/utils/resolve_after.test.ts b/src/lib/utils/resolve_after.test.ts
index 7e0cc3c..4b30d3c 100644
--- a/src/lib/utils/resolve_after.test.ts
+++ b/src/lib/utils/resolve_after.test.ts
@@ -1,37 +1,30 @@
import { resolveAfter } from './resolve_after';
describe('Resolve After', () => {
+ test('it should throw if given 0', () => {
+ expect(() => {
+ resolveAfter(0);
+ }).toThrow();
+ });
- test('it should throw if given 0', () => {
+ test('it should throw if given a negative number', () => {
+ expect(() => {
+ resolveAfter(-1);
+ }).toThrow();
+ });
- expect(() => {
+ test('it should resolve after the specified number of times', () => {
+ expect(() => {
+ const { counter, promise: resolveAfterThree } = resolveAfter(3);
+ let resolved = false;
- resolveAfter(0);
- }).toThrow();
- });
-
- test('it should throw if given a negative number', () => {
-
- expect(() => {
-
- resolveAfter(-1);
- }).toThrow();
- });
-
- test('it should resolve after the specified number of times', () => {
-
- expect(() => {
-
- const { counter, promise: resolveAfterThree } = resolveAfter(3);
- let resolved = false;
-
- resolveAfterThree.then(() => (resolved = true));
- counter();
- expect(resolved).toBe(false);
- counter();
- expect(resolved).toBe(false);
- counter();
- expect(resolved).toBe(true);
- }).toThrow();
- });
+ resolveAfterThree.then(() => (resolved = true));
+ counter();
+ expect(resolved).toBe(false);
+ counter();
+ expect(resolved).toBe(false);
+ counter();
+ expect(resolved).toBe(true);
+ }).toThrow();
+ });
});