From 1464b756a4ef091ef97d1bf7340188ab5fe5492a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 19 Sep 2022 09:32:21 -0500 Subject: refactor: move out test files from root testdata directory into sub directories (#15949) --- cli/tests/testdata/info/json_output/main.out | 90 ++++++++++++++++++++++++++++ cli/tests/testdata/info/json_output/main.ts | 11 ++++ 2 files changed, 101 insertions(+) create mode 100644 cli/tests/testdata/info/json_output/main.out create mode 100644 cli/tests/testdata/info/json_output/main.ts (limited to 'cli/tests/testdata/info/json_output') diff --git a/cli/tests/testdata/info/json_output/main.out b/cli/tests/testdata/info/json_output/main.out new file mode 100644 index 000000000..124fc7351 --- /dev/null +++ b/cli/tests/testdata/info/json_output/main.out @@ -0,0 +1,90 @@ +{ + "roots": [ + "file://[WILDCARD]/info/json_output/main.ts" + ], + "modules": [ + { + "dependencies": [ + { + "specifier": "../../subdir/mod1.ts", + "code": { + "specifier": "file://[WILDCARD]/subdir/mod1.ts", + "span": { + "start": { + "line": 0, + "character": 52 + }, + "end": { + "line": 0, + "character": 74 + } + } + } + } + ], + "kind": "esm", + "local": "[WILDCARD]main.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/json_output/main.ts" + }, + { + "dependencies": [ + { + "specifier": "./subdir2/mod2.ts", + "code": { + "specifier": "file://[WILDCARD]/subdir/subdir2/mod2.ts", + "span": { + "start": { + "line": 0, + "character": 40 + }, + "end": { + "line": 0, + "character": 59 + } + } + } + } + ], + "kind": "esm", + "local": "[WILDCARD]mod1.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/subdir/mod1.ts" + }, + { + "kind": "esm", + "local": "[WILDCARD]print_hello.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/subdir/print_hello.ts" + }, + { + "dependencies": [ + { + "specifier": "../print_hello.ts", + "code": { + "specifier": "file://[WILDCARD]/subdir/print_hello.ts", + "span": { + "start": { + "line": 0, + "character": 27 + }, + "end": { + "line": 0, + "character": 46 + } + } + } + } + ], + "kind": "esm", + "local": "[WILDCARD]mod2.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/subdir/subdir2/mod2.ts" + } + ], + "redirects": {} +} diff --git a/cli/tests/testdata/info/json_output/main.ts b/cli/tests/testdata/info/json_output/main.ts new file mode 100644 index 000000000..927bc55ed --- /dev/null +++ b/cli/tests/testdata/info/json_output/main.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "../../subdir/mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} -- cgit v1.2.3