diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2022-09-19 09:32:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-19 10:32:21 -0400 |
| commit | 1464b756a4ef091ef97d1bf7340188ab5fe5492a (patch) | |
| tree | 2eff346ccf5782c501460aec63a5028742066fa6 /cli/tests/testdata/compile | |
| parent | 8d50c09c0db4e9b0644263cde3f7ff990ec75259 (diff) | |
refactor: move out test files from root testdata directory into sub directories (#15949)
Diffstat (limited to 'cli/tests/testdata/compile')
10 files changed, 35 insertions, 0 deletions
diff --git a/cli/tests/testdata/compile/args.ts b/cli/tests/testdata/compile/args.ts new file mode 100644 index 000000000..ec41d52f9 --- /dev/null +++ b/cli/tests/testdata/compile/args.ts @@ -0,0 +1,3 @@ +Deno.args.forEach((arg) => { + console.log(arg); +}); diff --git a/cli/tests/testdata/compile/standalone_error.ts b/cli/tests/testdata/compile/standalone_error.ts new file mode 100644 index 000000000..279398113 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_error.ts @@ -0,0 +1,9 @@ +function boom() { + throw new Error("boom!"); +} + +function foo() { + boom(); +} + +foo(); diff --git a/cli/tests/testdata/compile/standalone_error_module_with_imports_1.ts b/cli/tests/testdata/compile/standalone_error_module_with_imports_1.ts new file mode 100644 index 000000000..bf38f7263 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_error_module_with_imports_1.ts @@ -0,0 +1 @@ +import "./standalone_error_module_with_imports_2.ts"; diff --git a/cli/tests/testdata/compile/standalone_error_module_with_imports_2.ts b/cli/tests/testdata/compile/standalone_error_module_with_imports_2.ts new file mode 100644 index 000000000..ef052b512 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_error_module_with_imports_2.ts @@ -0,0 +1,2 @@ +console.log("hello"); +throw new Error("boom!"); diff --git a/cli/tests/testdata/compile/standalone_follow_redirects.ts b/cli/tests/testdata/compile/standalone_follow_redirects.ts new file mode 100644 index 000000000..f0957bc3d --- /dev/null +++ b/cli/tests/testdata/compile/standalone_follow_redirects.ts @@ -0,0 +1,2 @@ +import "./standalone_follow_redirects_2.js"; +console.log("Hello"); diff --git a/cli/tests/testdata/compile/standalone_follow_redirects_2.js b/cli/tests/testdata/compile/standalone_follow_redirects_2.js new file mode 100644 index 000000000..c0130ef5a --- /dev/null +++ b/cli/tests/testdata/compile/standalone_follow_redirects_2.js @@ -0,0 +1,5 @@ +// unversioned import redirects with dependencies. +import { + assertNotEquals as _a, + assertStrictEquals as _b, +} from "https://deno.land/std/testing/asserts.ts"; diff --git a/cli/tests/testdata/compile/standalone_import_datauri.ts b/cli/tests/testdata/compile/standalone_import_datauri.ts new file mode 100644 index 000000000..68f348828 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_import_datauri.ts @@ -0,0 +1,4 @@ +const c = await import( + "data:text/javascript;base64,ZXhwb3J0IGRlZmF1bHQgJ0hlbGxvIERlbm8hJw==" +); +console.log(c.default); // Output: "Hello Deno!" diff --git a/cli/tests/testdata/compile/standalone_import_map.json b/cli/tests/testdata/compile/standalone_import_map.json new file mode 100644 index 000000000..9e5b90bd7 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "hello": "../run/001_hello.js" + } +} diff --git a/cli/tests/testdata/compile/standalone_import_map.ts b/cli/tests/testdata/compile/standalone_import_map.ts new file mode 100644 index 000000000..097b96356 --- /dev/null +++ b/cli/tests/testdata/compile/standalone_import_map.ts @@ -0,0 +1 @@ +import "hello"; diff --git a/cli/tests/testdata/compile/standalone_runtime_flags.ts b/cli/tests/testdata/compile/standalone_runtime_flags.ts new file mode 100644 index 000000000..0154c7f4e --- /dev/null +++ b/cli/tests/testdata/compile/standalone_runtime_flags.ts @@ -0,0 +1,3 @@ +console.log(Math.random()); +await Deno.stat("."); +await Deno.create("foo.txt"); |
