summaryrefslogtreecommitdiff
path: root/tests/specs/run/_012_async
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/run/_012_async')
-rw-r--r--tests/specs/run/_012_async/012_async.ts11
-rw-r--r--tests/specs/run/_012_async/012_async.ts.out3
-rw-r--r--tests/specs/run/_012_async/__test__.jsonc4
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/specs/run/_012_async/012_async.ts b/tests/specs/run/_012_async/012_async.ts
new file mode 100644
index 000000000..536197b68
--- /dev/null
+++ b/tests/specs/run/_012_async/012_async.ts
@@ -0,0 +1,11 @@
+// Check that we can use the async keyword.
+async function main() {
+ await new Promise((resolve) => {
+ console.log("2");
+ setTimeout(resolve, 100);
+ });
+ console.log("3");
+}
+
+console.log("1");
+main();
diff --git a/tests/specs/run/_012_async/012_async.ts.out b/tests/specs/run/_012_async/012_async.ts.out
new file mode 100644
index 000000000..01e79c32a
--- /dev/null
+++ b/tests/specs/run/_012_async/012_async.ts.out
@@ -0,0 +1,3 @@
+1
+2
+3
diff --git a/tests/specs/run/_012_async/__test__.jsonc b/tests/specs/run/_012_async/__test__.jsonc
new file mode 100644
index 000000000..2778f0484
--- /dev/null
+++ b/tests/specs/run/_012_async/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "run --quiet --reload 012_async.ts",
+ "output": "012_async.ts.out"
+}