diff options
-rw-r--r-- | js/timers_test.ts | 10 | ||||
-rw-r--r-- | tests/010_set_interval.test | 2 | ||||
-rw-r--r-- | tests/010_set_interval.ts | 7 | ||||
-rw-r--r-- | tests/010_set_interval.ts.out | 2 |
4 files changed, 4 insertions, 17 deletions
diff --git a/js/timers_test.ts b/js/timers_test.ts index d1bce82a9..b43817437 100644 --- a/js/timers_test.ts +++ b/js/timers_test.ts @@ -132,11 +132,9 @@ test(async function intervalCancelSuccess() { let count = 0; const id = setInterval(() => { count++; - }, 500); - // Cancelled, count should not increment + }, 1); clearInterval(id); - // Wait a bit longer than 500ms - await waitForMs(600); + await waitForMs(500); assertEquals(count, 0); }); @@ -150,9 +148,9 @@ test(async function intervalOrdering() { } } for (let i = 0; i < 10; i++) { - timers[i] = setTimeout(onTimeout, 20); + timers[i] = setTimeout(onTimeout, 1); } - await waitForMs(100); + await waitForMs(500); assertEquals(timeouts, 1); }); diff --git a/tests/010_set_interval.test b/tests/010_set_interval.test deleted file mode 100644 index 08ef3d36c..000000000 --- a/tests/010_set_interval.test +++ /dev/null @@ -1,2 +0,0 @@ -args: --reload tests/010_set_interval.ts -output: tests/010_set_interval.ts.out diff --git a/tests/010_set_interval.ts b/tests/010_set_interval.ts deleted file mode 100644 index ee0641c5a..000000000 --- a/tests/010_set_interval.ts +++ /dev/null @@ -1,7 +0,0 @@ -const id = setInterval(() => { - console.log("test"); -}, 200); - -setTimeout(() => { - clearInterval(id); -}, 500); diff --git a/tests/010_set_interval.ts.out b/tests/010_set_interval.ts.out deleted file mode 100644 index dec2cbe1f..000000000 --- a/tests/010_set_interval.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -test -test |