deno.land / std@0.91.0 / async / delay_test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.import { delay } from "./delay.ts";import { assert } from "../testing/asserts.ts";
Deno.test("[async] delay", async function (): Promise<void> { const start = new Date(); const delayedPromise = delay(100); const result = await delayedPromise; const diff = new Date().getTime() - start.getTime(); assert(result === undefined); assert(diff >= 100);});
std

Version Info

Tagged at
3 years ago

External Dependencies

No external dependencies 🎉