summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-07 16:21:32 -0700
committerGitHub <noreply@github.com>2024-02-07 23:21:32 +0000
commit64ebd441e9f1b929c936aab1445afec10b8b7417 (patch)
tree8735c495b5800aeb39bb291373ad4a930d48a10d
parent13616d62e9f16641dfe9257d41f96d425a6a1480 (diff)
chore: use @test_util for node_compat tests (#22331)
-rw-r--r--cli/tests/integration/node_compat_tests.rs3
-rw-r--r--cli/tests/node_compat/common.ts6
-rw-r--r--cli/tests/node_compat/deno.json5
-rw-r--r--cli/tests/node_compat/runner.ts2
-rw-r--r--cli/tests/node_compat/test.ts8
-rw-r--r--tools/node_compat/deno.json3
-rwxr-xr-xtools/node_compat/setup.ts12
7 files changed, 25 insertions, 14 deletions
diff --git a/cli/tests/integration/node_compat_tests.rs b/cli/tests/integration/node_compat_tests.rs
index 30d307417..0ed84594b 100644
--- a/cli/tests/integration/node_compat_tests.rs
+++ b/cli/tests/integration/node_compat_tests.rs
@@ -8,6 +8,9 @@ fn node_compat_tests() {
let mut deno = util::deno_cmd()
.current_dir(util::root_path())
.arg("test")
+ .arg("--config")
+ .arg("cli/tests/config/deno.json")
+ .arg("--no-lock")
.arg("--unstable")
.arg("-A")
.arg(util::tests_path().join("node_compat"))
diff --git a/cli/tests/node_compat/common.ts b/cli/tests/node_compat/common.ts
index b3663ec3c..e079c6aaf 100644
--- a/cli/tests/node_compat/common.ts
+++ b/cli/tests/node_compat/common.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { partition } from "../../../test_util/std/collections/partition.ts";
-import { join } from "../../../test_util/std/path/mod.ts";
-import * as JSONC from "../../../test_util/std/jsonc/mod.ts";
+import { partition } from "@test_util/std/collections/partition.ts";
+import { join } from "@test_util/std/path/mod.ts";
+import * as JSONC from "@test_util/std/jsonc/mod.ts";
/**
* The test suite matches the folders inside the `test` folder inside the
* node repo
diff --git a/cli/tests/node_compat/deno.json b/cli/tests/node_compat/deno.json
new file mode 100644
index 000000000..fe518960f
--- /dev/null
+++ b/cli/tests/node_compat/deno.json
@@ -0,0 +1,5 @@
+{
+ "imports": {
+ "@test_util/": "../../../test_util/"
+ }
+}
diff --git a/cli/tests/node_compat/runner.ts b/cli/tests/node_compat/runner.ts
index 11ccefa82..4695037cc 100644
--- a/cli/tests/node_compat/runner.ts
+++ b/cli/tests/node_compat/runner.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import "./polyfill_globals.js";
import { createRequire } from "node:module";
-import { toFileUrl } from "../../../test_util/std/path/mod.ts";
+import { toFileUrl } from "@test_util/std/path/mod.ts";
const file = Deno.args[0];
if (!file) {
throw new Error("No file provided");
diff --git a/cli/tests/node_compat/test.ts b/cli/tests/node_compat/test.ts
index a57fd11a5..13ff429b5 100644
--- a/cli/tests/node_compat/test.ts
+++ b/cli/tests/node_compat/test.ts
@@ -13,10 +13,10 @@
* all share the same working directory.
*/
-import { magenta } from "../../../test_util/std/fmt/colors.ts";
-import { pooledMap } from "../../../test_util/std/async/pool.ts";
-import { dirname, fromFileUrl, join } from "../../../test_util/std/path/mod.ts";
-import { fail } from "../../../test_util/std/assert/mod.ts";
+import { magenta } from "@test_util/std/fmt/colors.ts";
+import { pooledMap } from "@test_util/std/async/pool.ts";
+import { dirname, fromFileUrl, join } from "@test_util/std/path/mod.ts";
+import { fail } from "@test_util/std/assert/mod.ts";
import {
config,
getPathsFromTestSuites,
diff --git a/tools/node_compat/deno.json b/tools/node_compat/deno.json
index 6e9c891a0..87fe18d08 100644
--- a/tools/node_compat/deno.json
+++ b/tools/node_compat/deno.json
@@ -1,4 +1,7 @@
{
+ "imports": {
+ "@test_util/": "../../test_util/"
+ },
"tasks": {
"setup": "deno run --allow-read --allow-write ./setup.ts",
"test": "deno test -A ../../cli/tests/node_compat/test.ts --"
diff --git a/tools/node_compat/setup.ts b/tools/node_compat/setup.ts
index 2844cffdd..4770fbc50 100755
--- a/tools/node_compat/setup.ts
+++ b/tools/node_compat/setup.ts
@@ -3,12 +3,12 @@
/** This copies the test files according to the config file `cli/tests/node_compat/config.jsonc` */
-import { walk } from "../../test_util/std/fs/walk.ts";
-import { sep } from "../../test_util/std/path/mod.ts";
-import { ensureFile } from "../../test_util/std/fs/ensure_file.ts";
-import { writeAll } from "../../test_util/std/streams/write_all.ts";
-import { withoutAll } from "../../test_util/std/collections/without_all.ts";
-import { relative } from "../../test_util/std/path/posix.ts";
+import { walk } from "@test_util/std/fs/walk.ts";
+import { sep } from "@test_util/std/path/mod.ts";
+import { ensureFile } from "@test_util/std/fs/ensure_file.ts";
+import { writeAll } from "@test_util/std/streams/write_all.ts";
+import { withoutAll } from "@test_util/std/collections/without_all.ts";
+import { relative } from "@test_util/std/path/posix.ts";
import { config, ignoreList } from "../../cli/tests/node_compat/common.ts";