diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-02-10 13:22:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 20:22:13 +0000 |
commit | f5e46c9bf2f50d66a953fa133161fc829cecff06 (patch) | |
tree | 8faf2f5831c1c7b11d842cd9908d141082c869a5 /tests/testdata/module_graph | |
parent | d2477f780630a812bfd65e3987b70c0d309385bb (diff) |
chore: move cli/tests/ -> tests/ (#22369)
This looks like a massive PR, but it's only a move from cli/tests ->
tests, and updates of relative paths for files.
This is the first step towards aggregate all of the integration test
files under tests/, which will lead to a set of integration tests that
can run without the CLI binary being built.
While we could leave these tests under `cli`, it would require us to
keep a more complex directory structure for the various test runners. In
addition, we have a lot of complexity to ignore various test files in
the `cli` project itself (cargo publish exclusion rules, autotests =
false, etc).
And finally, the `tests/` folder will eventually house the `test_ffi`,
`test_napi` and other testing code, reducing the size of the root repo
directory.
For easier review, the extremely large and noisy "move" is in the first
commit (with no changes -- just a move), while the remainder of the
changes to actual files is in the second commit.
Diffstat (limited to 'tests/testdata/module_graph')
31 files changed, 119 insertions, 0 deletions
diff --git a/tests/testdata/module_graph/file_tests-a.mjs b/tests/testdata/module_graph/file_tests-a.mjs new file mode 100644 index 000000000..72b3a67bc --- /dev/null +++ b/tests/testdata/module_graph/file_tests-a.mjs @@ -0,0 +1,3 @@ +import * as b from "./b.ts"; + +console.log(b); diff --git a/tests/testdata/module_graph/file_tests-b-mod.js b/tests/testdata/module_graph/file_tests-b-mod.js new file mode 100644 index 000000000..59d168993 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-b-mod.js @@ -0,0 +1 @@ +export const b = "b"; diff --git a/tests/testdata/module_graph/file_tests-b.ts b/tests/testdata/module_graph/file_tests-b.ts new file mode 100644 index 000000000..59d168993 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-b.ts @@ -0,0 +1 @@ +export const b = "b"; diff --git a/tests/testdata/module_graph/file_tests-c-mod.ts b/tests/testdata/module_graph/file_tests-c-mod.ts new file mode 100644 index 000000000..7f2cfac77 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-c-mod.ts @@ -0,0 +1 @@ +export const c = "c"; diff --git a/tests/testdata/module_graph/file_tests-checkwithconfig.ts b/tests/testdata/module_graph/file_tests-checkwithconfig.ts new file mode 100644 index 000000000..e7af5fa19 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-checkwithconfig.ts @@ -0,0 +1,5 @@ +import { ServerRequest } from "https://deno.land/std/http/server.ts"; + +export default (req: ServerRequest) => { + req.respond({ body: `Hello, from Deno v${Deno.version.deno}!` }); +}; diff --git a/tests/testdata/module_graph/file_tests-diag.ts b/tests/testdata/module_graph/file_tests-diag.ts new file mode 100644 index 000000000..ba365234a --- /dev/null +++ b/tests/testdata/module_graph/file_tests-diag.ts @@ -0,0 +1,4 @@ +import * as c from "./c/mod.ts"; + +// deno-lint-ignore no-undef +consol.log(c); diff --git a/tests/testdata/module_graph/file_tests-dynamicimport.ts b/tests/testdata/module_graph/file_tests-dynamicimport.ts new file mode 100644 index 000000000..b5c9f080f --- /dev/null +++ b/tests/testdata/module_graph/file_tests-dynamicimport.ts @@ -0,0 +1,5 @@ +try { + await import("bare_module_specifier"); +} catch (err) { + console.log(err); +} diff --git a/tests/testdata/module_graph/file_tests-importjson.ts b/tests/testdata/module_graph/file_tests-importjson.ts new file mode 100644 index 000000000..c2bc2bca7 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-importjson.ts @@ -0,0 +1,3 @@ +import * as config from "./some.json"; + +console.log(config); diff --git a/tests/testdata/module_graph/file_tests-importremap.ts b/tests/testdata/module_graph/file_tests-importremap.ts new file mode 100644 index 000000000..17f012673 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-importremap.ts @@ -0,0 +1,3 @@ +import * as a from "https://deno.land/x/a/mod.ts"; + +console.log(a); diff --git a/tests/testdata/module_graph/file_tests-main.ts b/tests/testdata/module_graph/file_tests-main.ts new file mode 100644 index 000000000..aa8eef1b8 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-main.ts @@ -0,0 +1,4 @@ +// @deno-types="https://deno.land/x/lib/mod.d.ts" +import * as lib from "https://deno.land/x/lib/mod.js"; + +console.log(lib); diff --git a/tests/testdata/module_graph/file_tests-some.json b/tests/testdata/module_graph/file_tests-some.json new file mode 100644 index 000000000..567c4ba21 --- /dev/null +++ b/tests/testdata/module_graph/file_tests-some.json @@ -0,0 +1,5 @@ +{ + "config": { + "debug": true + } +} diff --git a/tests/testdata/module_graph/file_typesref.d.ts b/tests/testdata/module_graph/file_typesref.d.ts new file mode 100644 index 000000000..8ae31dde3 --- /dev/null +++ b/tests/testdata/module_graph/file_typesref.d.ts @@ -0,0 +1 @@ +export const a: "a"; diff --git a/tests/testdata/module_graph/file_typesref.js b/tests/testdata/module_graph/file_typesref.js new file mode 100644 index 000000000..79da24cae --- /dev/null +++ b/tests/testdata/module_graph/file_typesref.js @@ -0,0 +1,3 @@ +/// <reference types="./typesref.d.ts" /> + +export const a = "a"; diff --git a/tests/testdata/module_graph/https_deno.land-std-http-server.ts b/tests/testdata/module_graph/https_deno.land-std-http-server.ts new file mode 100644 index 000000000..0b3c995ec --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-std-http-server.ts @@ -0,0 +1,5 @@ +export class ServerRequest { + respond(value: { body: string }) { + console.log(value); + } +} diff --git a/tests/testdata/module_graph/https_deno.land-x-a-mod.ts b/tests/testdata/module_graph/https_deno.land-x-a-mod.ts new file mode 100644 index 000000000..1e334d399 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-a-mod.ts @@ -0,0 +1 @@ +export * as b from "../b/mod.js"; diff --git a/tests/testdata/module_graph/https_deno.land-x-a.ts b/tests/testdata/module_graph/https_deno.land-x-a.ts new file mode 100644 index 000000000..a6e3cea80 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-a.ts @@ -0,0 +1 @@ +export const a = "hello"; diff --git a/tests/testdata/module_graph/https_deno.land-x-import_map.ts b/tests/testdata/module_graph/https_deno.land-x-import_map.ts new file mode 100644 index 000000000..e285d863a --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-import_map.ts @@ -0,0 +1,4 @@ +import * as $ from "jquery"; +import * as _ from "lodash"; + +console.log($, _); diff --git a/tests/testdata/module_graph/https_deno.land-x-jquery.js b/tests/testdata/module_graph/https_deno.land-x-jquery.js new file mode 100644 index 000000000..71896157a --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-jquery.js @@ -0,0 +1,3 @@ +const $ = {}; + +export default $; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-a.ts b/tests/testdata/module_graph/https_deno.land-x-lib-a.ts new file mode 100644 index 000000000..a0a6f8e94 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-a.ts @@ -0,0 +1 @@ +export const a: string[] = []; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-b.js b/tests/testdata/module_graph/https_deno.land-x-lib-b.js new file mode 100644 index 000000000..13cacdd8b --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-b.js @@ -0,0 +1 @@ +export const b = []; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-c.d.ts b/tests/testdata/module_graph/https_deno.land-x-lib-c.d.ts new file mode 100644 index 000000000..fac988e49 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-c.d.ts @@ -0,0 +1 @@ +export const c: string[]; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-c.js b/tests/testdata/module_graph/https_deno.land-x-lib-c.js new file mode 100644 index 000000000..620ca0b66 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-c.js @@ -0,0 +1,3 @@ +/// <reference types="./c.d.ts" /> + +export const c = []; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-mod.d.ts b/tests/testdata/module_graph/https_deno.land-x-lib-mod.d.ts new file mode 100644 index 000000000..76ed81df0 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-mod.d.ts @@ -0,0 +1,9 @@ +export * as a from "./a.ts"; +export * as b from "./b.js"; +export * as c from "./c.js"; + +export interface A { + a: string; +} + +export const mod: A[]; diff --git a/tests/testdata/module_graph/https_deno.land-x-lib-mod.js b/tests/testdata/module_graph/https_deno.land-x-lib-mod.js new file mode 100644 index 000000000..505162094 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-lib-mod.js @@ -0,0 +1,5 @@ +export * as a from "./a.ts"; +export * as b from "./b.js"; +export * as c from "./c.js"; + +export const mod = []; diff --git a/tests/testdata/module_graph/https_deno.land-x-mod.ts b/tests/testdata/module_graph/https_deno.land-x-mod.ts new file mode 100644 index 000000000..35d76ef75 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-mod.ts @@ -0,0 +1,3 @@ +import * as a from "./a.ts"; + +console.log(a); diff --git a/tests/testdata/module_graph/https_deno.land-x-transpile.tsx b/tests/testdata/module_graph/https_deno.land-x-transpile.tsx new file mode 100644 index 000000000..02955bad8 --- /dev/null +++ b/tests/testdata/module_graph/https_deno.land-x-transpile.tsx @@ -0,0 +1,5 @@ +export default class A { + render() { + return <div>Hello world!</div>; + } +} diff --git a/tests/testdata/module_graph/https_unpkg.com-lodash-index.js b/tests/testdata/module_graph/https_unpkg.com-lodash-index.js new file mode 100644 index 000000000..d16c126a6 --- /dev/null +++ b/tests/testdata/module_graph/https_unpkg.com-lodash-index.js @@ -0,0 +1,3 @@ +const _ = {}; + +export default _; diff --git a/tests/testdata/module_graph/lockfile.json b/tests/testdata/module_graph/lockfile.json new file mode 100644 index 000000000..03cfe1185 --- /dev/null +++ b/tests/testdata/module_graph/lockfile.json @@ -0,0 +1,8 @@ +{ + "https://deno.land/x/lib/a.ts": "4437fee72a750d9540a9575ea6426761d0aa1beedfa308fb1bc38701d97011b8", + "https://deno.land/x/lib/b.js": "093cc4164ca7a9adb11597ad291e021634f0b2d8c048137f7e9fb0d709499028", + "https://deno.land/x/lib/c.d.ts": "a95647377477cc663559f5e857bf318c584622ed1295a8ccb0c091d06bee0456", + "https://deno.land/x/lib/c.js": "4ff934f4b3b06f320c3130326376d9f2435e2ecedd582940ca90938137d004e1", + "https://deno.land/x/lib/mod.d.ts": "e54b994fbf63cb7f01076ea54f2ed67b185f2a48e8ff71d74bd9c8180a338eb7", + "https://deno.land/x/lib/mod.js": "3f6fcb8ef83ed6c66e71774d5079d14d22a6948dc6e5358ac30e0ab55e1a6404" +} diff --git a/tests/testdata/module_graph/lockfile_fail.json b/tests/testdata/module_graph/lockfile_fail.json new file mode 100644 index 000000000..c0019fba4 --- /dev/null +++ b/tests/testdata/module_graph/lockfile_fail.json @@ -0,0 +1,8 @@ +{ + "https://deno.land/x/lib/a.ts": "4437fee72a750d9540a9575ea6426761d0aa1beedfa308fb1bc38701d97011b8", + "https://deno.land/x/lib/b.js": "093cc4164ca7a9adb11597ad291e021634f0b2d8c048137f7e9fb0d709499028", + "https://deno.land/x/lib/c.d.ts": "a95647377477cc663559f5e857bf318c584622ed1295a8ccb0c091d06bee0456", + "https://deno.land/x/lib/c.js": "4ff934f4b3b06f320c3130326376d9f2435e2ecedd582940ca90938137d004e1", + "https://deno.land/x/lib/mod.d.ts": "e54b994fbf63cb7f01076ea54f2ed67b185f2a48e8ff71d74bd9c8180a338eb7", + "https://deno.land/x/lib/mod.js": "3f6fcb8ef83fd6c66e71774d5079d14d22a6948dc6e5358ac30e0ab55e1a6404" +} diff --git a/tests/testdata/module_graph/tsconfig.json b/tests/testdata/module_graph/tsconfig.json new file mode 100644 index 000000000..a4c5f4f33 --- /dev/null +++ b/tests/testdata/module_graph/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "target": "ES5", + "jsx": "preserve" + } +} diff --git a/tests/testdata/module_graph/tsconfig_01.json b/tests/testdata/module_graph/tsconfig_01.json new file mode 100644 index 000000000..f7496d475 --- /dev/null +++ b/tests/testdata/module_graph/tsconfig_01.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "strict": false, + "noImplicitAny": false, + "noImplicitThis": false, + "alwaysStrict": false, + "strictNullChecks": false, + "strictFunctionTypes": true, + "strictPropertyInitialization": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } +} |