mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
chore: use @test_util for node_compat tests (#22331)
This commit is contained in:
parent
13616d62e9
commit
64ebd441e9
7 changed files with 25 additions and 14 deletions
|
@ -8,6 +8,9 @@ fn node_compat_tests() {
|
||||||
let mut deno = util::deno_cmd()
|
let mut deno = util::deno_cmd()
|
||||||
.current_dir(util::root_path())
|
.current_dir(util::root_path())
|
||||||
.arg("test")
|
.arg("test")
|
||||||
|
.arg("--config")
|
||||||
|
.arg("cli/tests/config/deno.json")
|
||||||
|
.arg("--no-lock")
|
||||||
.arg("--unstable")
|
.arg("--unstable")
|
||||||
.arg("-A")
|
.arg("-A")
|
||||||
.arg(util::tests_path().join("node_compat"))
|
.arg(util::tests_path().join("node_compat"))
|
||||||
|
|
|
@ -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.
|
||||||
import { partition } from "../../../test_util/std/collections/partition.ts";
|
import { partition } from "@test_util/std/collections/partition.ts";
|
||||||
import { join } from "../../../test_util/std/path/mod.ts";
|
import { join } from "@test_util/std/path/mod.ts";
|
||||||
import * as JSONC from "../../../test_util/std/jsonc/mod.ts";
|
import * as JSONC from "@test_util/std/jsonc/mod.ts";
|
||||||
/**
|
/**
|
||||||
* The test suite matches the folders inside the `test` folder inside the
|
* The test suite matches the folders inside the `test` folder inside the
|
||||||
* node repo
|
* node repo
|
||||||
|
|
5
cli/tests/node_compat/deno.json
Normal file
5
cli/tests/node_compat/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"imports": {
|
||||||
|
"@test_util/": "../../../test_util/"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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.
|
||||||
import "./polyfill_globals.js";
|
import "./polyfill_globals.js";
|
||||||
import { createRequire } from "node:module";
|
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];
|
const file = Deno.args[0];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error("No file provided");
|
throw new Error("No file provided");
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* all share the same working directory.
|
* all share the same working directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { magenta } from "../../../test_util/std/fmt/colors.ts";
|
import { magenta } from "@test_util/std/fmt/colors.ts";
|
||||||
import { pooledMap } from "../../../test_util/std/async/pool.ts";
|
import { pooledMap } from "@test_util/std/async/pool.ts";
|
||||||
import { dirname, fromFileUrl, join } from "../../../test_util/std/path/mod.ts";
|
import { dirname, fromFileUrl, join } from "@test_util/std/path/mod.ts";
|
||||||
import { fail } from "../../../test_util/std/assert/mod.ts";
|
import { fail } from "@test_util/std/assert/mod.ts";
|
||||||
import {
|
import {
|
||||||
config,
|
config,
|
||||||
getPathsFromTestSuites,
|
getPathsFromTestSuites,
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{
|
{
|
||||||
|
"imports": {
|
||||||
|
"@test_util/": "../../test_util/"
|
||||||
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"setup": "deno run --allow-read --allow-write ./setup.ts",
|
"setup": "deno run --allow-read --allow-write ./setup.ts",
|
||||||
"test": "deno test -A ../../cli/tests/node_compat/test.ts --"
|
"test": "deno test -A ../../cli/tests/node_compat/test.ts --"
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
/** This copies the test files according to the config file `cli/tests/node_compat/config.jsonc` */
|
/** 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 { walk } from "@test_util/std/fs/walk.ts";
|
||||||
import { sep } from "../../test_util/std/path/mod.ts";
|
import { sep } from "@test_util/std/path/mod.ts";
|
||||||
import { ensureFile } from "../../test_util/std/fs/ensure_file.ts";
|
import { ensureFile } from "@test_util/std/fs/ensure_file.ts";
|
||||||
import { writeAll } from "../../test_util/std/streams/write_all.ts";
|
import { writeAll } from "@test_util/std/streams/write_all.ts";
|
||||||
import { withoutAll } from "../../test_util/std/collections/without_all.ts";
|
import { withoutAll } from "@test_util/std/collections/without_all.ts";
|
||||||
import { relative } from "../../test_util/std/path/posix.ts";
|
import { relative } from "@test_util/std/path/posix.ts";
|
||||||
|
|
||||||
import { config, ignoreList } from "../../cli/tests/node_compat/common.ts";
|
import { config, ignoreList } from "../../cli/tests/node_compat/common.ts";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue