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