chore: use @test_util for node_compat tests (#22331)

This commit is contained in:
Matt Mastracci 2024-02-07 16:21:32 -07:00 committed by GitHub
parent 13616d62e9
commit 64ebd441e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 14 deletions

View file

@ -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"))

View file

@ -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

View file

@ -0,0 +1,5 @@
{
"imports": {
"@test_util/": "../../../test_util/"
}
}

View file

@ -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");

View file

@ -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,

View file

@ -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 --"

View file

@ -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";