deno/tools/node_compat_tests.js
Bartek Iwańczuk 46ec01374e
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
test: add shorthand script to run all Node test and filtering to it (#29224)
This commit adds a new "tools/node_compat_tests.js" script that runs
"tests/node_compat/node_compat_test.ts" file.

Additionally ability to filter tests has been added (that only works
if we're not running in CI), that can be enabled like so:
```
$ tools/node_compat_tests.js --filter timers-unref-active
```
2025-05-17 02:08:21 +02:00

27 lines
709 B
JavaScript
Executable file

#!/usr/bin/env -S deno run --allow-all --config=tests/config/deno.json
// Copyright 2018-2025 the Deno authors. MIT license.
import { join, resolve } from "./util.js";
const currentDir = import.meta.dirname;
const testsDir = resolve(currentDir, "../tests/");
const args = [
"-A",
"--config",
join(testsDir, "config/deno.json"),
join(testsDir, "node_compat/run_all_test_unmodified.ts"),
];
let filterIdx = Deno.args.indexOf("--filter");
if (filterIdx === -1) {
filterIdx = Deno.args.indexOf("-f");
}
if (filterIdx !== -1) {
args.push("--filter");
args.push(Deno.args.at(filterIdx + 1));
}
await new Deno.Command(Deno.execPath(), {
args,
stdout: "inherit",
stderr: "inherit",
}).spawn();