aboutsummaryrefslogtreecommitdiff
path: root/src/utils/resolve_after.test.js
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2022-05-01 00:56:06 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2022-05-01 00:56:06 +0200
commita7cf03c192470cbab13edeb1aec99e0c66dede10 (patch)
tree581b4430d1de958dcb666bae80a7678332134602 /src/utils/resolve_after.test.js
parent010f307346e525ac2e4239a0549d2c1a4d6d102b (diff)
Update / use typescript
Diffstat (limited to 'src/utils/resolve_after.test.js')
-rw-r--r--src/utils/resolve_after.test.js45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/utils/resolve_after.test.js b/src/utils/resolve_after.test.js
deleted file mode 100644
index f7fc753..0000000
--- a/src/utils/resolve_after.test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-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 throw if given a negative number', () => {
-
- expect(() => {
-
- resolveAfter('lol');
- }).toThrow();
- });
-
- test('it should resolve after the specified number of times', () => {
-
- expect(() => {
-
- const { counter, 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();
- });
-});