diff options
| author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-07-25 10:26:54 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-25 10:26:54 +1000 |
| commit | f248050cb467eaed8d65428b8808254e26797cc5 (patch) | |
| tree | 7e43f16a8754a6313f65f0f65c037fdae2ce986f /tests/testdata | |
| parent | 795ed23b356dc044cfb497a6189d588604a6c335 (diff) | |
chore: use `@std` prefix for internal module specifiers (#24543)
This change aims to replace all relative import specifiers targeted at
`tests/util/std` with mapped ones (using a `deno.json` file). Towards
updating the `std` git submodule.
Diffstat (limited to 'tests/testdata')
21 files changed, 27 insertions, 32 deletions
diff --git a/tests/testdata/cert/listen_tls_alpn_fail.ts b/tests/testdata/cert/listen_tls_alpn_fail.ts index 78fa39500..484c28212 100644 --- a/tests/testdata/cert/listen_tls_alpn_fail.ts +++ b/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -1,4 +1,4 @@ -import { assertRejects } from "../../../tests/util/std/assert/mod.ts"; +import { assertRejects } from "@std/assert/mod.ts"; const listener = Deno.listenTls({ port: Number(Deno.args[0]), diff --git a/tests/testdata/compile/dynamic_imports/main_unanalyzable.ts b/tests/testdata/compile/dynamic_imports/main_unanalyzable.ts index 34fb76dc4..e2ff07aa1 100644 --- a/tests/testdata/compile/dynamic_imports/main_unanalyzable.ts +++ b/tests/testdata/compile/dynamic_imports/main_unanalyzable.ts @@ -1,15 +1,11 @@ -import { join } from "../../../../tests/util/std/path/mod.ts"; - console.log("Starting the main module"); // We load the dynamic import path from the file system, to make sure any // improvements in static analysis can't defeat the purpose of this test, which // is to make sure the `--include` flag works to add non-analyzed imports to the // module graph. -const IMPORT_PATH_FILE_PATH = join( - Deno.cwd(), - "tests/testdata/compile/dynamic_imports/import_path", -); +const IMPORT_PATH_FILE_PATH = + "./tests/testdata/compile/dynamic_imports/import_path"; setTimeout(async () => { console.log("Dynamic importing"); diff --git a/tests/testdata/compile/standalone_follow_redirects_2.js b/tests/testdata/compile/standalone_follow_redirects_2.js index 1d00679f3..a7639c82c 100644 --- a/tests/testdata/compile/standalone_follow_redirects_2.js +++ b/tests/testdata/compile/standalone_follow_redirects_2.js @@ -2,4 +2,4 @@ import { assertNotEquals as _a, assertStrictEquals as _b, -} from "../../../tests/util/std/assert/mod.ts"; +} from "@std/assert/mod.ts"; diff --git a/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts index c9cc648ea..5ec2117f0 100644 --- a/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts +++ b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts @@ -1,4 +1,4 @@ -import { assertSnapshot } from "../../../../tests/util/std/testing/snapshot.ts"; +import { assertSnapshot } from "@std/testing/snapshot.ts"; import { truth } from "./no_snaps_included.ts"; Deno.test("the truth", () => { diff --git a/tests/testdata/coverage/no_tests_included/foo.test.js b/tests/testdata/coverage/no_tests_included/foo.test.js index 4c835026a..e838badea 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.js +++ b/tests/testdata/coverage/no_tests_included/foo.test.js @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "../../../../tests/util/std/assert/mod.ts"; +import { assertEquals } from "@std/assert/mod.ts"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_tests_included/foo.test.mts b/tests/testdata/coverage/no_tests_included/foo.test.mts index 4c835026a..e838badea 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.mts +++ b/tests/testdata/coverage/no_tests_included/foo.test.mts @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "../../../../tests/util/std/assert/mod.ts"; +import { assertEquals } from "@std/assert/mod.ts"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_tests_included/foo.test.ts b/tests/testdata/coverage/no_tests_included/foo.test.ts index 4c835026a..e838badea 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.ts +++ b/tests/testdata/coverage/no_tests_included/foo.test.ts @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "../../../../tests/util/std/assert/mod.ts"; +import { assertEquals } from "@std/assert/mod.ts"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_transpiled_lines/index.ts b/tests/testdata/coverage/no_transpiled_lines/index.ts index 27b2dd758..5cda523fb 100644 --- a/tests/testdata/coverage/no_transpiled_lines/index.ts +++ b/tests/testdata/coverage/no_transpiled_lines/index.ts @@ -1,3 +1,3 @@ -export { assertStrictEquals } from "../../../../tests/util/std/assert/mod.ts"; +export { assertStrictEquals } from "@std/assert/mod.ts"; export * from "./interface.ts"; diff --git a/tests/testdata/echo_server.ts b/tests/testdata/echo_server.ts index 9352e0634..b75805dbc 100644 --- a/tests/testdata/echo_server.ts +++ b/tests/testdata/echo_server.ts @@ -1,4 +1,4 @@ -import { copy } from "../../tests/util/std/io/copy.ts"; +import { copy } from "@std/io/copy.ts"; const addr = Deno.args[0] || "0.0.0.0:4544"; const [hostname, port] = addr.split(":"); const listener = Deno.listen({ hostname, port: Number(port) }); diff --git a/tests/testdata/run/import_meta/importmap.json b/tests/testdata/run/import_meta/importmap.json index d85fe3028..7d583dd81 100644 --- a/tests/testdata/run/import_meta/importmap.json +++ b/tests/testdata/run/import_meta/importmap.json @@ -1,5 +1,7 @@ { "imports": { + "@std/": "../../../util/std/", + "bare": "https://example.com/", "https://example.com/rewrite": "https://example.com/rewritten", diff --git a/tests/testdata/run/import_meta/main.ts b/tests/testdata/run/import_meta/main.ts index 384a9232e..6e4d5be98 100644 --- a/tests/testdata/run/import_meta/main.ts +++ b/tests/testdata/run/import_meta/main.ts @@ -1,4 +1,4 @@ -import { assertThrows } from "../../../../tests/util/std/assert/mod.ts"; +import { assertThrows } from "@std/assert/mod.ts"; import "http://localhost:4545/run/import_meta/other.ts"; import "./other.ts"; diff --git a/tests/testdata/run/onload/imported.ts b/tests/testdata/run/onload/imported.ts index 5c412bd43..38649b9b3 100644 --- a/tests/testdata/run/onload/imported.ts +++ b/tests/testdata/run/onload/imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -import { assert } from "../../../../tests/util/std/assert/mod.ts"; +import { assert } from "@std/assert/mod.ts"; import "./nest_imported.ts"; const handler = (e: Event) => { diff --git a/tests/testdata/run/onload/main.ts b/tests/testdata/run/onload/main.ts index e3eae99fa..c0e120d96 100644 --- a/tests/testdata/run/onload/main.ts +++ b/tests/testdata/run/onload/main.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix no-prototype-builtins -import { assert } from "../../../../tests/util/std/assert/mod.ts"; +import { assert } from "@std/assert/mod.ts"; import "./imported.ts"; assert(window.hasOwnProperty("onload")); diff --git a/tests/testdata/run/onload/nest_imported.ts b/tests/testdata/run/onload/nest_imported.ts index 61af36e0a..98775d943 100644 --- a/tests/testdata/run/onload/nest_imported.ts +++ b/tests/testdata/run/onload/nest_imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -import { assert } from "../../../../tests/util/std/assert/mod.ts"; +import { assert } from "@std/assert/mod.ts"; const handler = (e: Event) => { assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); diff --git a/tests/testdata/run/textproto.ts b/tests/testdata/run/textproto.ts index f35ab6734..d1b667c15 100644 --- a/tests/testdata/run/textproto.ts +++ b/tests/testdata/run/textproto.ts @@ -14,11 +14,8 @@ * @module */ -import type { - BufReader, - ReadLineResult, -} from "../../../tests/util/std/io/buf_reader.ts"; -import { concat } from "../../../tests/util/std/bytes/concat.ts"; +import type { BufReader, ReadLineResult } from "@std/io/buf_reader.ts"; +import { concat } from "@std/bytes/concat.ts"; // Constants created for DRY const CHAR_SPACE: number = " ".charCodeAt(0); diff --git a/tests/testdata/run/tls_connecttls.js b/tests/testdata/run/tls_connecttls.js index b3cc3f339..540dd5721 100644 --- a/tests/testdata/run/tls_connecttls.js +++ b/tests/testdata/run/tls_connecttls.js @@ -1,5 +1,5 @@ -import { assert, assertEquals } from "../../../tests/util/std/assert/mod.ts"; -import { BufReader, BufWriter } from "../../../tests/util/std/io/mod.ts"; +import { assert, assertEquals } from "@std/assert/mod.ts"; +import { BufReader, BufWriter } from "@std/io/mod.ts"; import { TextProtoReader } from "./textproto.ts"; const encoder = new TextEncoder(); diff --git a/tests/testdata/run/tls_starttls.js b/tests/testdata/run/tls_starttls.js index ebe0d0725..eb550d9be 100644 --- a/tests/testdata/run/tls_starttls.js +++ b/tests/testdata/run/tls_starttls.js @@ -1,6 +1,6 @@ -import { assert, assertEquals } from "../../../tests/util/std/assert/mod.ts"; -import { BufReader } from "../../../tests/util/std/io/buf_reader.ts"; -import { BufWriter } from "../../../tests/util/std/io/buf_writer.ts"; +import { assert, assertEquals } from "@std/assert/mod.ts"; +import { BufReader } from "@std/io/buf_reader.ts"; +import { BufWriter } from "@std/io/buf_writer.ts"; import { TextProtoReader } from "./textproto.ts"; const encoder = new TextEncoder(); diff --git a/tests/testdata/run/websocket_server_idletimeout.ts b/tests/testdata/run/websocket_server_idletimeout.ts index 82a35605a..aa1da5ccd 100644 --- a/tests/testdata/run/websocket_server_idletimeout.ts +++ b/tests/testdata/run/websocket_server_idletimeout.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../../../tests/util/std/assert/mod.ts"; +import { assertEquals } from "@std/assert/mod.ts"; const errorDeferred = Promise.withResolvers<void>(); const closeDeferred = Promise.withResolvers<void>(); diff --git a/tests/testdata/test/allow_all.ts b/tests/testdata/test/allow_all.ts index 44d61d99b..589f200df 100644 --- a/tests/testdata/test/allow_all.ts +++ b/tests/testdata/test/allow_all.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../../../tests/util/std/assert/mod.ts"; +import { assertEquals } from "@std/assert/mod.ts"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/tests/testdata/test/allow_none.ts b/tests/testdata/test/allow_none.ts index 359f31700..903a926ba 100644 --- a/tests/testdata/test/allow_none.ts +++ b/tests/testdata/test/allow_none.ts @@ -1,4 +1,4 @@ -import { unreachable } from "../../../tests/util/std/assert/mod.ts"; +import { unreachable } from "@std/assert/mod.ts"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/tests/testdata/workers/deno_worker.ts b/tests/testdata/workers/deno_worker.ts index 9928b378b..ca16d4fa4 100644 --- a/tests/testdata/workers/deno_worker.ts +++ b/tests/testdata/workers/deno_worker.ts @@ -1,4 +1,4 @@ -import { assert } from "../../../tests/util/std/assert/mod.ts"; +import { assert } from "@std/assert/mod.ts"; onmessage = function (e) { if (typeof self.Deno === "undefined") { |
