summaryrefslogtreecommitdiff
path: root/tests/012_async.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-08-10 15:16:41 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-08-11 09:02:07 -0700
commit4772c14d125f61e0f78107f686d24ac72bd72d7c (patch)
tree76f314e54417076d5298252f3284cf7d510365d3 /tests/012_async.ts
parentc7ce450ee97497944756b6af60034521953431fc (diff)
Add async tests from prototype
Diffstat (limited to 'tests/012_async.ts')
-rw-r--r--tests/012_async.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/012_async.ts b/tests/012_async.ts
new file mode 100644
index 000000000..57ae355c2
--- /dev/null
+++ b/tests/012_async.ts
@@ -0,0 +1,11 @@
+// Check that we can use the async keyword.
+async function main() {
+ await new Promise((resolve, reject) => {
+ console.log("2");
+ setTimeout(resolve, 100);
+ });
+ console.log("3");
+}
+
+console.log("1");
+main();