From 15a763152f9d392cb80692262f8de5ef8ae15495 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 11 Aug 2021 10:20:47 -0400 Subject: chore: move test files to testdata directory (#11601) --- cli/tests/testdata/tla3/b.js | 7 +++++++ cli/tests/testdata/tla3/timeout_loop.js | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 cli/tests/testdata/tla3/b.js create mode 100644 cli/tests/testdata/tla3/timeout_loop.js (limited to 'cli/tests/testdata/tla3') diff --git a/cli/tests/testdata/tla3/b.js b/cli/tests/testdata/tla3/b.js new file mode 100644 index 000000000..b74c659e4 --- /dev/null +++ b/cli/tests/testdata/tla3/b.js @@ -0,0 +1,7 @@ +import { foo } from "./timeout_loop.js"; +import { collection } from "../top_level_await_circular.js"; + +console.log("collection in b", collection); +console.log("foo in b", foo); + +export const a = "a"; diff --git a/cli/tests/testdata/tla3/timeout_loop.js b/cli/tests/testdata/tla3/timeout_loop.js new file mode 100644 index 000000000..860e6cd2a --- /dev/null +++ b/cli/tests/testdata/tla3/timeout_loop.js @@ -0,0 +1,23 @@ +export const foo = "foo"; + +export function delay(ms) { + return new Promise((res) => + setTimeout(() => { + res(); + }, ms) + ); +} + +let i = 0; + +async function timeoutLoop() { + await delay(1000); + console.log("timeout loop", i); + i++; + if (i > 5) { + return; + } + timeoutLoop(); +} + +timeoutLoop(); -- cgit v1.2.3