mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
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.
This commit is contained in:
parent
795ed23b35
commit
f248050cb4
52 changed files with 96 additions and 81 deletions
10
.github/workflows/ci.generate.ts
vendored
10
.github/workflows/ci.generate.ts
vendored
|
@ -826,7 +826,7 @@ const ci = {
|
||||||
"!startsWith(github.ref, 'refs/tags/')",
|
"!startsWith(github.ref, 'refs/tags/')",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
run:
|
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)",
|
name: "Test (full, debug)",
|
||||||
|
@ -879,9 +879,9 @@ const ci = {
|
||||||
DENO_BIN: "./target/debug/deno",
|
DENO_BIN: "./target/debug/deno",
|
||||||
},
|
},
|
||||||
run: [
|
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",
|
" ./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"',
|
' ./tests/wpt/wpt.ts run --quiet --binary="$DENO_BIN"',
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
},
|
},
|
||||||
|
@ -892,9 +892,9 @@ const ci = {
|
||||||
DENO_BIN: "./target/release/deno",
|
DENO_BIN: "./target/release/deno",
|
||||||
},
|
},
|
||||||
run: [
|
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",
|
" ./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 \\",
|
" ./tests/wpt/wpt.ts run --quiet --release \\",
|
||||||
' --binary="$DENO_BIN" \\',
|
' --binary="$DENO_BIN" \\',
|
||||||
" --json=wpt.json \\",
|
" --json=wpt.json \\",
|
||||||
|
|
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -494,7 +494,7 @@ jobs:
|
||||||
matrix.job == 'test' &&
|
matrix.job == 'test' &&
|
||||||
matrix.profile == 'release' &&
|
matrix.profile == 'release' &&
|
||||||
!startsWith(github.ref, 'refs/tags/'))
|
!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)'
|
- name: 'Test (full, debug)'
|
||||||
if: |-
|
if: |-
|
||||||
!(matrix.skip) && (matrix.job == 'test' &&
|
!(matrix.skip) && (matrix.job == 'test' &&
|
||||||
|
@ -531,18 +531,18 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DENO_BIN: ./target/debug/deno
|
DENO_BIN: ./target/debug/deno
|
||||||
run: |-
|
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
|
./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"
|
./tests/wpt/wpt.ts run --quiet --binary="$DENO_BIN"
|
||||||
- name: Run web platform tests (release)
|
- name: Run web platform tests (release)
|
||||||
if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''release'')'
|
if: '!(matrix.skip) && (matrix.wpt && matrix.profile == ''release'')'
|
||||||
env:
|
env:
|
||||||
DENO_BIN: ./target/release/deno
|
DENO_BIN: ./target/release/deno
|
||||||
run: |-
|
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
|
./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 \
|
./tests/wpt/wpt.ts run --quiet --release \
|
||||||
--binary="$DENO_BIN" \
|
--binary="$DENO_BIN" \
|
||||||
--json=wpt.json \
|
--json=wpt.json \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// 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, {
|
const { port } = parse(Deno.args, {
|
||||||
number: ["port"],
|
number: ["port"],
|
||||||
|
|
|
@ -11,7 +11,8 @@ const AUTOBAHN_TESTSUITE_DOCKER =
|
||||||
"crossbario/autobahn-testsuite:0.8.2@sha256:5d4ba3aa7d6ab2fdbf6606f3f4ecbe4b66f205ce1cbc176d6cdf650157e52242";
|
"crossbario/autobahn-testsuite:0.8.2@sha256:5d4ba3aa7d6ab2fdbf6606f3f4ecbe4b66f205ce1cbc176d6cdf650157e52242";
|
||||||
|
|
||||||
const self = Deno.execPath();
|
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++) {
|
for (let i = 0; i < 6; i++) {
|
||||||
try {
|
try {
|
||||||
|
|
5
import_map.json
Normal file
5
import_map.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"imports": {
|
||||||
|
"@std/": "./tests/util/std/"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
{
|
{
|
||||||
"imports": {
|
"lock": false,
|
||||||
"@test_util/": "../../test_util/",
|
"importMap": "../../import_map.json"
|
||||||
"@std/": "../util/std/"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,8 @@ fn standalone_follow_redirects() {
|
||||||
"compile",
|
"compile",
|
||||||
"--output",
|
"--output",
|
||||||
&exe.to_string_lossy(),
|
&exe.to_string_lossy(),
|
||||||
|
"--config",
|
||||||
|
"../config/deno.json",
|
||||||
"./compile/standalone_follow_redirects.ts",
|
"./compile/standalone_follow_redirects.ts",
|
||||||
])
|
])
|
||||||
.run()
|
.run()
|
||||||
|
|
|
@ -216,6 +216,8 @@ fn no_snaps_included(test_name: &str, extension: &str) {
|
||||||
"--quiet".to_string(),
|
"--quiet".to_string(),
|
||||||
"--allow-read".to_string(),
|
"--allow-read".to_string(),
|
||||||
format!("--coverage={}", tempdir),
|
format!("--coverage={}", tempdir),
|
||||||
|
"--config".to_string(),
|
||||||
|
"../config/deno.json".to_string(),
|
||||||
format!("coverage/no_snaps_included/{test_name}_test.{extension}"),
|
format!("coverage/no_snaps_included/{test_name}_test.{extension}"),
|
||||||
])
|
])
|
||||||
.run();
|
.run();
|
||||||
|
@ -256,6 +258,8 @@ fn no_tests_included(test_name: &str, extension: &str) {
|
||||||
"--quiet".to_string(),
|
"--quiet".to_string(),
|
||||||
"--allow-read".to_string(),
|
"--allow-read".to_string(),
|
||||||
format!("--coverage={}", tempdir),
|
format!("--coverage={}", tempdir),
|
||||||
|
"--config".to_string(),
|
||||||
|
"../config/deno.json".to_string(),
|
||||||
format!("coverage/no_tests_included/{test_name}.test.{extension}"),
|
format!("coverage/no_tests_included/{test_name}.test.{extension}"),
|
||||||
])
|
])
|
||||||
.run();
|
.run();
|
||||||
|
@ -337,6 +341,8 @@ fn no_transpiled_lines() {
|
||||||
"test".to_string(),
|
"test".to_string(),
|
||||||
"--quiet".to_string(),
|
"--quiet".to_string(),
|
||||||
format!("--coverage={}", tempdir),
|
format!("--coverage={}", tempdir),
|
||||||
|
"--config".to_string(),
|
||||||
|
"../config/deno.json".to_string(),
|
||||||
"coverage/no_transpiled_lines/".to_string(),
|
"coverage/no_transpiled_lines/".to_string(),
|
||||||
])
|
])
|
||||||
.run();
|
.run();
|
||||||
|
|
|
@ -206,7 +206,7 @@ itest!(_033_import_map_data_uri {
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(onload {
|
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",
|
output: "run/onload/main.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3163,12 +3163,12 @@ mod permissions {
|
||||||
}
|
}
|
||||||
|
|
||||||
itest!(tls_starttls {
|
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",
|
output: "run/tls.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(tls_connecttls {
|
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",
|
output: "run/tls.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4512,6 +4512,8 @@ async fn websocket_server_idletimeout() {
|
||||||
.arg("--allow-net")
|
.arg("--allow-net")
|
||||||
.arg("--cert")
|
.arg("--cert")
|
||||||
.arg(root_ca)
|
.arg(root_ca)
|
||||||
|
.arg("--config")
|
||||||
|
.arg("./config/deno.json")
|
||||||
.arg(script)
|
.arg(script)
|
||||||
.stdout_piped()
|
.stdout_piped()
|
||||||
.spawn()
|
.spawn()
|
||||||
|
@ -5377,6 +5379,8 @@ async fn listen_tls_alpn_fail() {
|
||||||
.arg("--quiet")
|
.arg("--quiet")
|
||||||
.arg("--allow-net")
|
.arg("--allow-net")
|
||||||
.arg("--allow-read")
|
.arg("--allow-read")
|
||||||
|
.arg("--config")
|
||||||
|
.arg("../config/deno.json")
|
||||||
.arg("./cert/listen_tls_alpn_fail.ts")
|
.arg("./cert/listen_tls_alpn_fail.ts")
|
||||||
.arg("4505")
|
.arg("4505")
|
||||||
.stdout_piped()
|
.stdout_piped()
|
||||||
|
|
|
@ -251,13 +251,13 @@ itest!(no_run {
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(allow_all {
|
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,
|
exit_code: 0,
|
||||||
output: "test/allow_all.out",
|
output: "test/allow_all.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(allow_none {
|
itest!(allow_none {
|
||||||
args: "test test/allow_none.ts",
|
args: "test --config ../config/deno.json test/allow_none.ts",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
output: "test/allow_none.out",
|
output: "test/allow_none.out",
|
||||||
});
|
});
|
||||||
|
|
|
@ -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.
|
// 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` */
|
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
"args": "run -A --unstable-fs main.js",
|
"args": "run -A --unstable-fs --config ../../../config/deno.json main.js",
|
||||||
"output": "main.out",
|
"output": "main.out",
|
||||||
"envs": {
|
"envs": {
|
||||||
"DENO_FUTURE": "1"
|
"DENO_FUTURE": "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"args": "run -A --unstable-fs worker.js",
|
"args": "run -A --unstable-fs --config ../../../config/deno.json worker.js",
|
||||||
"output": "main.out",
|
"output": "main.out",
|
||||||
"envs": {
|
"envs": {
|
||||||
"DENO_FUTURE": "1"
|
"DENO_FUTURE": "1"
|
||||||
|
|
|
@ -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" });
|
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
|
||||||
await delay(1_000);
|
await delay(1_000);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
// Notice `--unstable-*` flags are not needed anymore
|
// Notice `--unstable-*` flags are not needed anymore
|
||||||
"args": "run -A main.js",
|
"args": "run -A --config ../../../config/deno.json main.js",
|
||||||
"output": "main.out",
|
"output": "main.out",
|
||||||
"envs": {
|
"envs": {
|
||||||
"DENO_FUTURE": "1"
|
"DENO_FUTURE": "1"
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Notice `--unstable-*` flags are not needed anymore
|
// Notice `--unstable-*` flags are not needed anymore
|
||||||
"args": "run -A worker.js",
|
"args": "run -A --config ../../../config/deno.json worker.js",
|
||||||
"output": "main.out",
|
"output": "main.out",
|
||||||
"envs": {
|
"envs": {
|
||||||
"DENO_FUTURE": "1"
|
"DENO_FUTURE": "1"
|
||||||
|
|
|
@ -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" });
|
const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
|
||||||
await delay(1_000);
|
await delay(1_000);
|
||||||
|
|
|
@ -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"
|
"output": "proxy_test.ts.out"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// 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";
|
const addr = Deno.args[1] || "localhost:4555";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"args": "run -A main.js",
|
"args": "run -A --config ../../../config/deno.json main.js",
|
||||||
"exitCode": 0,
|
"exitCode": 0,
|
||||||
"output": "main.out"
|
"output": "main.out"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 DIR = "./coverage";
|
||||||
const COMMAND = new Deno.Command(Deno.execPath(), {
|
const COMMAND = new Deno.Command(Deno.execPath(), {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { sum } from "./sum.js";
|
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()", () => {
|
Deno.test("sum()", () => {
|
||||||
assertEquals(sum(1, 2), 3);
|
assertEquals(sum(1, 2), 3);
|
||||||
|
|
2
tests/testdata/cert/listen_tls_alpn_fail.ts
vendored
2
tests/testdata/cert/listen_tls_alpn_fail.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assertRejects } from "../../../tests/util/std/assert/mod.ts";
|
import { assertRejects } from "@std/assert/mod.ts";
|
||||||
|
|
||||||
const listener = Deno.listenTls({
|
const listener = Deno.listenTls({
|
||||||
port: Number(Deno.args[0]),
|
port: Number(Deno.args[0]),
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
import { join } from "../../../../tests/util/std/path/mod.ts";
|
|
||||||
|
|
||||||
console.log("Starting the main module");
|
console.log("Starting the main module");
|
||||||
|
|
||||||
// We load the dynamic import path from the file system, to make sure any
|
// 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
|
// 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
|
// is to make sure the `--include` flag works to add non-analyzed imports to the
|
||||||
// module graph.
|
// module graph.
|
||||||
const IMPORT_PATH_FILE_PATH = join(
|
const IMPORT_PATH_FILE_PATH =
|
||||||
Deno.cwd(),
|
"./tests/testdata/compile/dynamic_imports/import_path";
|
||||||
"tests/testdata/compile/dynamic_imports/import_path",
|
|
||||||
);
|
|
||||||
|
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
console.log("Dynamic importing");
|
console.log("Dynamic importing");
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
import {
|
import {
|
||||||
assertNotEquals as _a,
|
assertNotEquals as _a,
|
||||||
assertStrictEquals as _b,
|
assertStrictEquals as _b,
|
||||||
} from "../../../tests/util/std/assert/mod.ts";
|
} from "@std/assert/mod.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";
|
import { truth } from "./no_snaps_included.ts";
|
||||||
|
|
||||||
Deno.test("the truth", () => {
|
Deno.test("the truth", () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export { assertStrictEquals } from "../../../../tests/util/std/assert/mod.ts";
|
export { assertStrictEquals } from "@std/assert/mod.ts";
|
||||||
|
|
||||||
export * from "./interface.ts";
|
export * from "./interface.ts";
|
||||||
|
|
2
tests/testdata/echo_server.ts
vendored
2
tests/testdata/echo_server.ts
vendored
|
@ -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 addr = Deno.args[0] || "0.0.0.0:4544";
|
||||||
const [hostname, port] = addr.split(":");
|
const [hostname, port] = addr.split(":");
|
||||||
const listener = Deno.listen({ hostname, port: Number(port) });
|
const listener = Deno.listen({ hostname, port: Number(port) });
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
|
"@std/": "../../../util/std/",
|
||||||
|
|
||||||
"bare": "https://example.com/",
|
"bare": "https://example.com/",
|
||||||
"https://example.com/rewrite": "https://example.com/rewritten",
|
"https://example.com/rewrite": "https://example.com/rewritten",
|
||||||
|
|
||||||
|
|
2
tests/testdata/run/import_meta/main.ts
vendored
2
tests/testdata/run/import_meta/main.ts
vendored
|
@ -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 "http://localhost:4545/run/import_meta/other.ts";
|
||||||
import "./other.ts";
|
import "./other.ts";
|
||||||
|
|
||||||
|
|
2
tests/testdata/run/onload/imported.ts
vendored
2
tests/testdata/run/onload/imported.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix
|
// 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";
|
import "./nest_imported.ts";
|
||||||
|
|
||||||
const handler = (e: Event) => {
|
const handler = (e: Event) => {
|
||||||
|
|
2
tests/testdata/run/onload/main.ts
vendored
2
tests/testdata/run/onload/main.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix no-prototype-builtins
|
// 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";
|
import "./imported.ts";
|
||||||
|
|
||||||
assert(window.hasOwnProperty("onload"));
|
assert(window.hasOwnProperty("onload"));
|
||||||
|
|
2
tests/testdata/run/onload/nest_imported.ts
vendored
2
tests/testdata/run/onload/nest_imported.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix
|
// 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) => {
|
const handler = (e: Event) => {
|
||||||
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
||||||
|
|
7
tests/testdata/run/textproto.ts
vendored
7
tests/testdata/run/textproto.ts
vendored
|
@ -14,11 +14,8 @@
|
||||||
* @module
|
* @module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { BufReader, ReadLineResult } from "@std/io/buf_reader.ts";
|
||||||
BufReader,
|
import { concat } from "@std/bytes/concat.ts";
|
||||||
ReadLineResult,
|
|
||||||
} from "../../../tests/util/std/io/buf_reader.ts";
|
|
||||||
import { concat } from "../../../tests/util/std/bytes/concat.ts";
|
|
||||||
|
|
||||||
// Constants created for DRY
|
// Constants created for DRY
|
||||||
const CHAR_SPACE: number = " ".charCodeAt(0);
|
const CHAR_SPACE: number = " ".charCodeAt(0);
|
||||||
|
|
4
tests/testdata/run/tls_connecttls.js
vendored
4
tests/testdata/run/tls_connecttls.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
import { assert, assertEquals } from "../../../tests/util/std/assert/mod.ts";
|
import { assert, assertEquals } from "@std/assert/mod.ts";
|
||||||
import { BufReader, BufWriter } from "../../../tests/util/std/io/mod.ts";
|
import { BufReader, BufWriter } from "@std/io/mod.ts";
|
||||||
import { TextProtoReader } from "./textproto.ts";
|
import { TextProtoReader } from "./textproto.ts";
|
||||||
|
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
6
tests/testdata/run/tls_starttls.js
vendored
6
tests/testdata/run/tls_starttls.js
vendored
|
@ -1,6 +1,6 @@
|
||||||
import { assert, assertEquals } from "../../../tests/util/std/assert/mod.ts";
|
import { assert, assertEquals } from "@std/assert/mod.ts";
|
||||||
import { BufReader } from "../../../tests/util/std/io/buf_reader.ts";
|
import { BufReader } from "@std/io/buf_reader.ts";
|
||||||
import { BufWriter } from "../../../tests/util/std/io/buf_writer.ts";
|
import { BufWriter } from "@std/io/buf_writer.ts";
|
||||||
import { TextProtoReader } from "./textproto.ts";
|
import { TextProtoReader } from "./textproto.ts";
|
||||||
|
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
|
@ -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 errorDeferred = Promise.withResolvers<void>();
|
||||||
const closeDeferred = Promise.withResolvers<void>();
|
const closeDeferred = Promise.withResolvers<void>();
|
||||||
|
|
2
tests/testdata/test/allow_all.ts
vendored
2
tests/testdata/test/allow_all.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assertEquals } from "../../../tests/util/std/assert/mod.ts";
|
import { assertEquals } from "@std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
2
tests/testdata/test/allow_none.ts
vendored
2
tests/testdata/test/allow_none.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { unreachable } from "../../../tests/util/std/assert/mod.ts";
|
import { unreachable } from "@std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
2
tests/testdata/workers/deno_worker.ts
vendored
2
tests/testdata/workers/deno_worker.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assert } from "../../../tests/util/std/assert/mod.ts";
|
import { assert } from "@std/assert/mod.ts";
|
||||||
|
|
||||||
onmessage = function (e) {
|
onmessage = function (e) {
|
||||||
if (typeof self.Deno === "undefined") {
|
if (typeof self.Deno === "undefined") {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "./test_util.ts";
|
} 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;
|
const MAX_SIZE = 2 ** 32 - 2;
|
||||||
// N controls how many iterations of certain checks are performed.
|
// N controls how many iterations of certain checks are performed.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
/// FLAGS
|
/// 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";
|
import { join, resolve, ROOT_PATH } from "../../../tools/util.js";
|
||||||
|
|
||||||
export const {
|
export const {
|
||||||
|
|
|
@ -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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
// This script is used to run WPT tests for Deno.
|
// This script is used to run WPT tests for Deno.
|
||||||
|
@ -32,9 +32,9 @@ import {
|
||||||
updateManifest,
|
updateManifest,
|
||||||
wptreport,
|
wptreport,
|
||||||
} from "./runner/utils.ts";
|
} from "./runner/utils.ts";
|
||||||
import { pooledMap } from "../util/std/async/pool.ts";
|
import { pooledMap } from "@std/async/pool.ts";
|
||||||
import { blue, bold, green, red, yellow } from "../util/std/fmt/colors.ts";
|
import { blue, bold, green, red, yellow } from "@std/fmt/colors.ts";
|
||||||
import { writeAll, writeAllSync } from "../util/std/io/write_all.ts";
|
import { writeAll, writeAllSync } from "@std/io/write_all.ts";
|
||||||
import { saveExpectation } from "./runner/utils.ts";
|
import { saveExpectation } from "./runner/utils.ts";
|
||||||
|
|
||||||
class TestFilter {
|
class TestFilter {
|
||||||
|
|
|
@ -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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { getSources, ROOT_PATH } from "./util.js";
|
import { getSources, ROOT_PATH } from "./util.js";
|
||||||
|
|
4
tools/deno.json
Normal file
4
tools/deno.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"lock": false,
|
||||||
|
"importMap": "../import_map.json"
|
||||||
|
}
|
|
@ -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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
import { join, ROOT_PATH } from "./util.js";
|
import { join, ROOT_PATH } from "./util.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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
import { getPrebuilt } from "./util.js";
|
import { getPrebuilt } from "./util.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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
import { Node, Project, ts } from "npm:ts-morph@22.0.0";
|
import { Node, Project, ts } from "npm:ts-morph@22.0.0";
|
||||||
import { join, ROOT_PATH } from "./util.js";
|
import { join, ROOT_PATH } from "./util.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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
||||||
import { checkCopyright } from "./copyright_checker.js";
|
import { checkCopyright } from "./copyright_checker.js";
|
||||||
|
|
|
@ -5,12 +5,12 @@ import {
|
||||||
join,
|
join,
|
||||||
resolve,
|
resolve,
|
||||||
toFileUrl,
|
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";
|
import { wait } from "https://deno.land/x/wait@0.1.13/mod.ts";
|
||||||
export { dirname, fromFileUrl, join, resolve, toFileUrl };
|
export { dirname, fromFileUrl, join, resolve, toFileUrl };
|
||||||
export { existsSync, walk } from "../tests/util/std/fs/mod.ts";
|
export { existsSync, walk } from "@std/fs/mod.ts";
|
||||||
export { TextLineStream } from "../tests/util/std/streams/text_line_stream.ts";
|
export { TextLineStream } from "@std/streams/text_line_stream.ts";
|
||||||
export { delay } from "../tests/util/std/async/delay.ts";
|
export { delay } from "@std/async/delay.ts";
|
||||||
|
|
||||||
// [toolName] --version output
|
// [toolName] --version output
|
||||||
const versions = {
|
const versions = {
|
||||||
|
|
|
@ -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.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { join, ROOT_PATH } from "./util.js";
|
import { join, ROOT_PATH } from "./util.js";
|
||||||
|
|
Loading…
Reference in a new issue