std/async/delay_test.ts
William Perron 69f3d67cb2
chore: remove Promise<void> return type annotation (#819)
There's a couple of instances where `Promise<void>` is still there,
those are the exceptions, for example functions that explicitely return
a `Promise` object or functions that return the promise from another
function call without any `await` statement.

used this one-liner to automatically remove everything:

```bash
grep -rli 'promise<void>' | xargs sed -i 's/: Promise<void>//g
```
2021-04-05 07:49:05 -04:00

13 lines
425 B
TypeScript

// 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 () {
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);
});