mirror of
https://github.com/denoland/deno.git
synced 2025-01-27 09:22:08 -05:00
15 lines
452 B
TypeScript
15 lines
452 B
TypeScript
|
// Copyright 2018-2020 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);
|
||
|
});
|
||
|
|
||
|
export {};
|