summaryrefslogtreecommitdiff
path: root/cli/tests/012_async.ts
blob: 773272ca1922c3e45e7f54d6a9288f8973e2a80a (plain)
1
2
3
4
5
6
7
8
9
10
11
// 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();