]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/utils/resolve_after.test.ts
Don't remember what this WIP was about
[rbdr/forum] / src / lib / utils / resolve_after.test.ts
index 7e0cc3c5d0a671956d3939abb74d2f243b302fe4..4b30d3cc864ceb887a30f0cf72304f22329ed259 100644 (file)
@@ -1,37 +1,30 @@
 import { resolveAfter } from './resolve_after';
 
 describe('Resolve After', () => {
 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 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();
-  });
+       test('it should throw if given 0', () => {
+               expect(() => {
+                       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();
+       });
 });
 });