diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2021-06-25 10:44:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 03:44:14 +0200 |
commit | 66c5f41c5bd5fa08daa09f8650135000c1787829 (patch) | |
tree | 05ad5900822d01316ad0c193cd7fcc7953bdf32c /cli/tests/unit/http_test.ts | |
parent | dd4ed825762d32ca9f791bda3bb9c459886c7061 (diff) |
test(cli): refactor the usages of delay (#11098)
This PR refactors the usages of delay utility in js unit testing. The same
utiliy is defined in several places with different names. This PR replaces those
usages with the one provided in std/async/delay.ts to improve the readability
and consistency of test code.
Diffstat (limited to 'cli/tests/unit/http_test.ts')
-rw-r--r-- | cli/tests/unit/http_test.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts index d84a4bdd2..06ea1336a 100644 --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -8,6 +8,7 @@ import { assertEquals, assertThrowsAsync, deferred, + delay, unitTest, } from "./test_util.ts"; @@ -375,8 +376,6 @@ unitTest( unitTest( { perms: { net: true } }, async function httpServerNextRequestResolvesOnClose() { - const delay = (n: number) => - new Promise((resolve) => setTimeout(resolve, n)); const httpConnList: Deno.HttpConn[] = []; async function serve(l: Deno.Listener) { |