deno/cli/tests/012_async.ts
Kitson Kelly 9837d324a7 Update to TypeScript 3.7 (#3275)
and update to prettier 1.19

Also, update `assert()` and remove not null assertions where possibly
in `cli`.

Closes #3273
2019-11-13 13:42:34 -05:00

12 lines
231 B
TypeScript

// Check that we can use the async keyword.
async function main(): Promise<void> {
await new Promise((resolve): void => {
console.log("2");
setTimeout(resolve, 100);
});
console.log("3");
}
console.log("1");
main();