summaryrefslogtreecommitdiff
path: root/cli/tests/unit/performance_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/performance_test.ts')
-rw-r--r--cli/tests/unit/performance_test.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index accedd2e4..401ce2c16 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -5,19 +5,18 @@ import {
assertNotStrictEquals,
assertStringIncludes,
assertThrows,
- deferred,
} from "./test_util.ts";
Deno.test({ permissions: { hrtime: false } }, async function performanceNow() {
- const resolvable = deferred();
+ const { promise, resolve } = Promise.withResolvers<void>();
const start = performance.now();
let totalTime = 0;
setTimeout(() => {
const end = performance.now();
totalTime = end - start;
- resolvable.resolve();
+ resolve();
}, 10);
- await resolvable;
+ await promise;
assert(totalTime >= 10);
});