summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-07-25 10:26:54 +1000
committerGitHub <noreply@github.com>2024-07-25 10:26:54 +1000
commitf248050cb467eaed8d65428b8808254e26797cc5 (patch)
tree7e43f16a8754a6313f65f0f65c037fdae2ce986f
parent795ed23b356dc044cfb497a6189d588604a6c335 (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.
-rwxr-xr-x.github/workflows/ci.generate.ts10
-rw-r--r--.github/workflows/ci.yml10
-rw-r--r--ext/websocket/autobahn/autobahn_server.js2
-rw-r--r--ext/websocket/autobahn/fuzzingclient.js3
-rw-r--r--import_map.json5
-rw-r--r--tests/config/deno.json6
-rw-r--r--tests/integration/compile_tests.rs2
-rw-r--r--tests/integration/coverage_tests.rs6
-rw-r--r--tests/integration/run_tests.rs10
-rw-r--r--tests/integration/test_tests.rs4
-rwxr-xr-xtests/node_compat/runner/setup.ts2
-rw-r--r--tests/specs/future/runtime_api/__test__.jsonc4
-rw-r--r--tests/specs/future/runtime_api/worker.js2
-rw-r--r--tests/specs/future/unstable_flags/__test__.jsonc4
-rw-r--r--tests/specs/future/unstable_flags/worker.js2
-rw-r--r--tests/specs/run/045_proxy/__test__.jsonc2
-rw-r--r--tests/specs/run/045_proxy/proxy_test.ts2
-rw-r--r--tests/specs/test/clean_flag/__test__.jsonc2
-rw-r--r--tests/specs/test/clean_flag/main.js2
-rw-r--r--tests/specs/test/clean_flag/sum_test.js2
-rw-r--r--tests/testdata/cert/listen_tls_alpn_fail.ts2
-rw-r--r--tests/testdata/compile/dynamic_imports/main_unanalyzable.ts8
-rw-r--r--tests/testdata/compile/standalone_follow_redirects_2.js2
-rw-r--r--tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts2
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.js2
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.mts2
-rw-r--r--tests/testdata/coverage/no_tests_included/foo.test.ts2
-rw-r--r--tests/testdata/coverage/no_transpiled_lines/index.ts2
-rw-r--r--tests/testdata/echo_server.ts2
-rw-r--r--tests/testdata/run/import_meta/importmap.json2
-rw-r--r--tests/testdata/run/import_meta/main.ts2
-rw-r--r--tests/testdata/run/onload/imported.ts2
-rw-r--r--tests/testdata/run/onload/main.ts2
-rw-r--r--tests/testdata/run/onload/nest_imported.ts2
-rw-r--r--tests/testdata/run/textproto.ts7
-rw-r--r--tests/testdata/run/tls_connecttls.js4
-rw-r--r--tests/testdata/run/tls_starttls.js6
-rw-r--r--tests/testdata/run/websocket_server_idletimeout.ts2
-rw-r--r--tests/testdata/test/allow_all.ts2
-rw-r--r--tests/testdata/test/allow_none.ts2
-rw-r--r--tests/testdata/workers/deno_worker.ts2
-rw-r--r--tests/unit/buffer_test.ts2
-rw-r--r--tests/wpt/runner/utils.ts2
-rwxr-xr-xtests/wpt/wpt.ts8
-rwxr-xr-xtools/copyright_checker.js2
-rw-r--r--tools/deno.json4
-rwxr-xr-xtools/format.js2
-rwxr-xr-xtools/install_prebuilt.js2
-rwxr-xr-xtools/jsdoc_checker.js2
-rwxr-xr-xtools/lint.js2
-rw-r--r--tools/util.js8
-rwxr-xr-xtools/wgpu_sync.js2
52 files changed, 96 insertions, 81 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 04c2eafd6..b20b84643 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -826,7 +826,7 @@ const ci = {
"!startsWith(github.ref, 'refs/tags/')",
].join("\n"),
run:
- "target/release/deno run -A --unstable ext/websocket/autobahn/fuzzingclient.js",
+ "target/release/deno run -A --unstable --config tests/config/deno.json ext/websocket/autobahn/fuzzingclient.js",
},
{
name: "Test (full, debug)",
@@ -879,9 +879,9 @@ const ci = {
DENO_BIN: "./target/debug/deno",
},
run: [
- "deno run -A --unstable --lock=tools/deno.lock.json \\",
+ "deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\\",
" ./tests/wpt/wpt.ts setup",
- "deno run -A --unstable --lock=tools/deno.lock.json \\",
+ "deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\\",
' ./tests/wpt/wpt.ts run --quiet --binary="$DENO_BIN"',
].join("\n"),
},
@@ -892,9 +892,9 @@ const ci = {
DENO_BIN: "./target/release/deno",
},
run: [
- "deno run -A --unstable --lock=tools/deno.lock.json \\",
+ "deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\\",
" ./tests/wpt/wpt.ts setup",
- "deno run -A --unstable --lock=tools/deno.lock.json \\",
+ "deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\\",
" ./tests/wpt/wpt.ts run --quiet --release \\",
' --binary="$DENO_BIN" \\',
" --json=wpt.json \\",
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1e6f40b2e..6a1861c33 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -494,7 +494,7 @@ jobs:
matrix.job == 'test' &&
matrix.profile == 'release' &&
!startsWith(github.ref, 'refs/tags/'))
- run: target/release/deno run -A --unstable ext/websocket/autobahn/fuzzingclient.js
+ run: target/release/deno run -A --unstable --config tests/config/deno.json ext/websocket/autobahn/fuzzingclient.js
- name: 'Test (full, debug)'
if: |-
!(matrix.skip) && (matrix.job == 'test' &&
@@ -531,18 +531,18 @@ jobs:
env:
DENO_BIN: ./target/debug/deno
run: |-
- deno run -A --unstable --lock=tools/deno.lock.json \
+ deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\
./tests/wpt/wpt.ts setup
- deno run -A --unstable --lock=tools/deno.lock.json \
+ deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\
./tests/wpt/wpt.ts run --quiet --binary="$DENO_BIN"
- name: Run web platform tests (release)
if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''release'')'
env:
DENO_BIN: ./target/release/deno
run: |-
- deno run -A --unstable --lock=tools/deno.lock.json \
+ deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\
./tests/wpt/wpt.ts setup
- deno run -A --unstable --lock=tools/deno.lock.json \
+ deno run -A --unstable --lock=tools/deno.lock.json --config tests/config/deno.json\
./tests/wpt/wpt.ts run --quiet --release \
--binary="$DENO_BIN" \
--json=wpt.json \
diff --git a/ext/websocket/autobahn/autobahn_server.js b/ext/websocket/autobahn/autobahn_server.js
index 18b58ab1e..73e32a60f 100644
--- a/ext/websocket/autobahn/autobahn_server.js
+++ b/ext/websocket/autobahn/autobahn_server.js
@@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { parse } from "../../../tests/util/std/flags/mod.ts";
+import { parse } from "@std/flags/mod.ts";
const { port } = parse(Deno.args, {
number: ["port"],
diff --git a/ext/websocket/autobahn/fuzzingclient.js b/ext/websocket/autobahn/fuzzingclient.js
index 9edc7293f..a8cf0c2b7 100644
--- a/ext/websocket/autobahn/fuzzingclient.js
+++ b/ext/websocket/autobahn/fuzzingclient.js
@@ -11,7 +11,8 @@ const AUTOBAHN_TESTSUITE_DOCKER =
"crossbario/autobahn-testsuite:0.8.2@sha256:5d4ba3aa7d6ab2fdbf6606f3f4ecbe4b66f205ce1cbc176d6cdf650157e52242";
const self = Deno.execPath();
-$`${self} run -A --unstable ${pwd}/autobahn_server.js`.spawn();
+$`${self} run -A --unstable --config ${pwd}/../../../tests/config/deno.json ${pwd}/autobahn_server.js`
+ .spawn();
for (let i = 0; i < 6; i++) {
try {
diff --git a/import_map.json b/import_map.json
new file mode 100644
index 000000000..0f0240a05
--- /dev/null
+++ b/import_map.json
@@ -0,0 +1,5 @@
+{
+ "imports": {
+ "@std/": "./tests/util/std/"
+ }
+}
diff --git a/tests/config/deno.json b/tests/config/deno.json
index 8f629a65c..c1c6f5112 100644
--- a/tests/config/deno.json
+++ b/tests/config/deno.json
@@ -1,6 +1,4 @@
{
- "imports": {
- "@test_util/": "../../test_util/",
- "@std/": "../util/std/"
- }
+ "lock": false,
+ "importMap": "../../import_map.json"
}
diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs
index 17054637e..df9ea26df 100644
--- a/tests/integration/compile_tests.rs
+++ b/tests/integration/compile_tests.rs
@@ -195,6 +195,8 @@ fn standalone_follow_redirects() {
"compile",
"--output",
&exe.to_string_lossy(),
+ "--config",
+ "../config/deno.json",
"./compile/standalone_follow_redirects.ts",
])
.run()
diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs
index 51b82af07..c5f8b1453 100644
--- a/tests/integration/coverage_tests.rs
+++ b/tests/integration/coverage_tests.rs
@@ -216,6 +216,8 @@ fn no_snaps_included(test_name: &str, extension: &str) {
"--quiet".to_string(),
"--allow-read".to_string(),
format!("--coverage={}", tempdir),
+ "--config".to_string(),
+ "../config/deno.json".to_string(),
format!("coverage/no_snaps_included/{test_name}_test.{extension}"),
])
.run();
@@ -256,6 +258,8 @@ fn no_tests_included(test_name: &str, extension: &str) {
"--quiet".to_string(),
"--allow-read".to_string(),
format!("--coverage={}", tempdir),
+ "--config".to_string(),
+ "../config/deno.json".to_string(),
format!("coverage/no_tests_included/{test_name}.test.{extension}"),
])
.run();
@@ -337,6 +341,8 @@ fn no_transpiled_lines() {
"test".to_string(),
"--quiet".to_string(),
format!("--coverage={}", tempdir),
+ "--config".to_string(),
+ "../config/deno.json".to_string(),
"coverage/no_transpiled_lines/".to_string(),
])
.run();
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs
index 6a9b47b1a..73d98aff5 100644
--- a/tests/integration/run_tests.rs
+++ b/tests/integration/run_tests.rs
@@ -206,7 +206,7 @@ itest!(_033_import_map_data_uri {
});
itest!(onload {
- args: "run --quiet --reload run/onload/main.ts",
+ args: "run --quiet --reload --config ../config/deno.json run/onload/main.ts",
output: "run/onload/main.out",
});
@@ -3163,12 +3163,12 @@ mod permissions {
}
itest!(tls_starttls {
- args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem run/tls_starttls.js",
+ args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem --config ../config/deno.json run/tls_starttls.js",
output: "run/tls.out",
});
itest!(tls_connecttls {
- args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem run/tls_connecttls.js",
+ args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem --config ../config/deno.json run/tls_connecttls.js",
output: "run/tls.out",
});
@@ -4512,6 +4512,8 @@ async fn websocket_server_idletimeout() {
.arg("--allow-net")
.arg("--cert")
.arg(root_ca)
+ .arg("--config")
+ .arg("./config/deno.json")
.arg(script)
.stdout_piped()
.spawn()
@@ -5377,6 +5379,8 @@ async fn listen_tls_alpn_fail() {
.arg("--quiet")
.arg("--allow-net")
.arg("--allow-read")
+ .arg("--config")
+ .arg("../config/deno.json")
.arg("./cert/listen_tls_alpn_fail.ts")
.arg("4505")
.stdout_piped()
diff --git a/tests/integration/test_tests.rs b/tests/integration/test_tests.rs
index 2f5a620e1..d4934e03c 100644
--- a/tests/integration/test_tests.rs
+++ b/tests/integration/test_tests.rs
@@ -251,13 +251,13 @@ itest!(no_run {
});
itest!(allow_all {
- args: "test --allow-all test/allow_all.ts",
+ args: "test --config ../config/deno.json --allow-all test/allow_all.ts",
exit_code: 0,
output: "test/allow_all.out",
});
itest!(allow_none {
- args: "test test/allow_none.ts",
+ args: "test --config ../config/deno.json test/allow_none.ts",
exit_code: 1,
output: "test/allow_none.out",
});
diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts
index 22fc71086..5ef0bc3db 100755
--- a/tests/node_compat/runner/setup.ts
+++ b/tests/node_compat/runner/setup.ts
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-read=. --allow-write=. --allow-run=git
+#!/usr/bin/env -S deno run --allow-read=. --allow-write=. --allow-run=git --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
diff --git a/tests/specs/future/runtime_api/__test__.jsonc b/tests/specs/future/runtime_api/__test__.jsonc
index 7aceff5bf..c1b3b9b17 100644
--- a/tests/specs/future/runtime_api/__test__.jsonc
+++ b/tests/specs/future/runtime_api/__test__.jsonc
@@ -1,14 +1,14 @@
{
"steps": [
{
- "args": "run -A --unstable-fs main.js",
+ "args": "run -A --unstable-fs --config ../../../config/deno.json main.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
}
},
{
- "args": "run -A --unstable-fs worker.js",
+ "args": "run -A --unstable-fs --config ../../../config/deno.json worker.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
diff --git a/tests/specs/future/runtime_api/worker.js b/tests/specs/future/runtime_api/worker.js
index 64b8e07b8..36d35b7b2 100644
--- a/tests/specs/future/runtime_api/worker.js
+++ b/tests/specs/future/runtime_api/worker.js
@@ -1,4 +1,4 @@
-import { delay } from "../../../util/std/async/delay.ts";
+import { delay } from "@std/async/delay.ts";
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
await delay(1_000);
diff --git a/tests/specs/future/unstable_flags/__test__.jsonc b/tests/specs/future/unstable_flags/__test__.jsonc
index d3d02e029..008ba1213 100644
--- a/tests/specs/future/unstable_flags/__test__.jsonc
+++ b/tests/specs/future/unstable_flags/__test__.jsonc
@@ -2,7 +2,7 @@
"steps": [
{
// Notice `--unstable-*` flags are not needed anymore
- "args": "run -A main.js",
+ "args": "run -A --config ../../../config/deno.json main.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
@@ -10,7 +10,7 @@
},
{
// Notice `--unstable-*` flags are not needed anymore
- "args": "run -A worker.js",
+ "args": "run -A --config ../../../config/deno.json worker.js",
"output": "main.out",
"envs": {
"DENO_FUTURE": "1"
diff --git a/tests/specs/future/unstable_flags/worker.js b/tests/specs/future/unstable_flags/worker.js
index 64b8e07b8..36d35b7b2 100644
--- a/tests/specs/future/unstable_flags/worker.js
+++ b/tests/specs/future/unstable_flags/worker.js
@@ -1,4 +1,4 @@
-import { delay } from "../../../util/std/async/delay.ts";
+import { delay } from "@std/async/delay.ts";
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
await delay(1_000);
diff --git a/tests/specs/run/045_proxy/__test__.jsonc b/tests/specs/run/045_proxy/__test__.jsonc
index d4fb7f60c..c448d3c35 100644
--- a/tests/specs/run/045_proxy/__test__.jsonc
+++ b/tests/specs/run/045_proxy/__test__.jsonc
@@ -1,4 +1,4 @@
{
- "args": "run -L debug --allow-net --allow-env --allow-run --allow-read --reload --quiet proxy_test.ts",
+ "args": "run -L debug --allow-net --allow-env --allow-run --allow-read --reload --quiet --config ../../../config/deno.json proxy_test.ts",
"output": "proxy_test.ts.out"
}
diff --git a/tests/specs/run/045_proxy/proxy_test.ts b/tests/specs/run/045_proxy/proxy_test.ts
index 582b0e638..d04356930 100644
--- a/tests/specs/run/045_proxy/proxy_test.ts
+++ b/tests/specs/run/045_proxy/proxy_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { Server } from "../../../util/std/http/server.ts";
+import { Server } from "@std/http/server.ts";
const addr = Deno.args[1] || "localhost:4555";
diff --git a/tests/specs/test/clean_flag/__test__.jsonc b/tests/specs/test/clean_flag/__test__.jsonc
index 65ad097b1..b94612d36 100644
--- a/tests/specs/test/clean_flag/__test__.jsonc
+++ b/tests/specs/test/clean_flag/__test__.jsonc
@@ -1,5 +1,5 @@
{
- "args": "run -A main.js",
+ "args": "run -A --config ../../../config/deno.json main.js",
"exitCode": 0,
"output": "main.out"
}
diff --git a/tests/specs/test/clean_flag/main.js b/tests/specs/test/clean_flag/main.js
index 215c2229c..9ccdea1ce 100644
--- a/tests/specs/test/clean_flag/main.js
+++ b/tests/specs/test/clean_flag/main.js
@@ -1,4 +1,4 @@
-import { emptyDir } from "../../../util/std/fs/empty_dir.ts";
+import { emptyDir } from "@std/fs/empty_dir.ts";
const DIR = "./coverage";
const COMMAND = new Deno.Command(Deno.execPath(), {
diff --git a/tests/specs/test/clean_flag/sum_test.js b/tests/specs/test/clean_flag/sum_test.js
index 3443fcbd3..eab3c53ad 100644
--- a/tests/specs/test/clean_flag/sum_test.js
+++ b/tests/specs/test/clean_flag/sum_test.js
@@ -1,5 +1,5 @@
import { sum } from "./sum.js";
-import { assertEquals } from "../../../util/std/assert/assert_equals.ts";
+import { assertEquals } from "@std/assert/assert_equals.ts";
Deno.test("sum()", () => {
assertEquals(sum(1, 2), 3);
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") {
diff --git a/tests/unit/buffer_test.ts b/tests/unit/buffer_test.ts
index 88c867c0a..6d2123622 100644
--- a/tests/unit/buffer_test.ts
+++ b/tests/unit/buffer_test.ts
@@ -11,7 +11,7 @@ import {
assertRejects,
assertThrows,
} from "./test_util.ts";
-import { writeAllSync } from "../util/std/io/write_all.ts";
+import { writeAllSync } from "@std/io/write_all.ts";
const MAX_SIZE = 2 ** 32 - 2;
// N controls how many iterations of certain checks are performed.
diff --git a/tests/wpt/runner/utils.ts b/tests/wpt/runner/utils.ts
index 52b95eefe..988e06c09 100644
--- a/tests/wpt/runner/utils.ts
+++ b/tests/wpt/runner/utils.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/// FLAGS
-import { parse } from "../../util/std/flags/mod.ts";
+import { parse } from "@std/flags/mod.ts";
import { join, resolve, ROOT_PATH } from "../../../tools/util.js";
export const {
diff --git a/tests/wpt/wpt.ts b/tests/wpt/wpt.ts
index 161ea1af9..fe226d5bc 100755
--- a/tests/wpt/wpt.ts
+++ b/tests/wpt/wpt.ts
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-write --allow-read --allow-net --allow-env --allow-run
+#!/usr/bin/env -S deno run --allow-write --allow-read --allow-net --allow-env --allow-run --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This script is used to run WPT tests for Deno.
@@ -32,9 +32,9 @@ import {
updateManifest,
wptreport,
} from "./runner/utils.ts";
-import { pooledMap } from "../util/std/async/pool.ts";
-import { blue, bold, green, red, yellow } from "../util/std/fmt/colors.ts";
-import { writeAll, writeAllSync } from "../util/std/io/write_all.ts";
+import { pooledMap } from "@std/async/pool.ts";
+import { blue, bold, green, red, yellow } from "@std/fmt/colors.ts";
+import { writeAll, writeAllSync } from "@std/io/write_all.ts";
import { saveExpectation } from "./runner/utils.ts";
class TestFilter {
diff --git a/tools/copyright_checker.js b/tools/copyright_checker.js
index 4ffde77c1..486b32ba7 100755
--- a/tools/copyright_checker.js
+++ b/tools/copyright_checker.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-read=. --allow-run=git
+#!/usr/bin/env -S deno run --allow-read=. --allow-run=git --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { getSources, ROOT_PATH } from "./util.js";
diff --git a/tools/deno.json b/tools/deno.json
new file mode 100644
index 000000000..6e0d332db
--- /dev/null
+++ b/tools/deno.json
@@ -0,0 +1,4 @@
+{
+ "lock": false,
+ "importMap": "../import_map.json"
+}
diff --git a/tools/format.js b/tools/format.js
index e7b8f0d5f..c1f151b55 100755
--- a/tools/format.js
+++ b/tools/format.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net
+#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { join, ROOT_PATH } from "./util.js";
diff --git a/tools/install_prebuilt.js b/tools/install_prebuilt.js
index d8430b472..0c983d405 100755
--- a/tools/install_prebuilt.js
+++ b/tools/install_prebuilt.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --unstable --allow-write --allow-read --allow-net
+#!/usr/bin/env -S deno run --unstable --allow-write --allow-read --allow-net --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { getPrebuilt } from "./util.js";
diff --git a/tools/jsdoc_checker.js b/tools/jsdoc_checker.js
index 4cbccf535..3e5dc0371 100755
--- a/tools/jsdoc_checker.js
+++ b/tools/jsdoc_checker.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-read --allow-env --allow-sys
+#!/usr/bin/env -S deno run --allow-read --allow-env --allow-sys --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { Node, Project, ts } from "npm:ts-morph@22.0.0";
import { join, ROOT_PATH } from "./util.js";
diff --git a/tools/lint.js b/tools/lint.js
index dad963160..aa02a3e2b 100755
--- a/tools/lint.js
+++ b/tools/lint.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net
+#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
import { checkCopyright } from "./copyright_checker.js";
diff --git a/tools/util.js b/tools/util.js
index 251aaa1fa..2f0904bc4 100644
--- a/tools/util.js
+++ b/tools/util.js
@@ -5,12 +5,12 @@ import {
join,
resolve,
toFileUrl,
-} from "../tests/util/std/path/mod.ts";
+} from "@std/path/mod.ts";
import { wait } from "https://deno.land/x/wait@0.1.13/mod.ts";
export { dirname, fromFileUrl, join, resolve, toFileUrl };
-export { existsSync, walk } from "../tests/util/std/fs/mod.ts";
-export { TextLineStream } from "../tests/util/std/streams/text_line_stream.ts";
-export { delay } from "../tests/util/std/async/delay.ts";
+export { existsSync, walk } from "@std/fs/mod.ts";
+export { TextLineStream } from "@std/streams/text_line_stream.ts";
+export { delay } from "@std/async/delay.ts";
// [toolName] --version output
const versions = {
diff --git a/tools/wgpu_sync.js b/tools/wgpu_sync.js
index 4939983c2..1d9e180d5 100755
--- a/tools/wgpu_sync.js
+++ b/tools/wgpu_sync.js
@@ -1,4 +1,4 @@
-#!/usr/bin/env -S deno run --unstable --allow-read --allow-write --allow-run
+#!/usr/bin/env -S deno run --unstable --allow-read --allow-write --allow-run --config=tests/config/deno.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { join, ROOT_PATH } from "./util.js";