summaryrefslogtreecommitdiff
path: root/tests/node_compat/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/node_compat/test.ts')
-rw-r--r--tests/node_compat/test.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts
index 04a85f113..2f690e943 100644
--- a/tests/node_compat/test.ts
+++ b/tests/node_compat/test.ts
@@ -76,18 +76,24 @@ async function runTest(t: Deno.TestContext, path: string): Promise<void> {
// contain actual JS objects, not strings :)).
envVars["NODE_TEST_KNOWN_GLOBALS"] = "0";
}
-
+ // TODO(nathanwhit): once we match node's behavior on executing
+ // `node:test` tests when we run a file, we can remove this
+ const usesNodeTest = testSource.includes("node:test");
const args = [
- "run",
+ usesNodeTest ? "test" : "run",
"-A",
"--quiet",
//"--unsafely-ignore-certificate-errors",
"--unstable-unsafe-proto",
"--unstable-bare-node-builtins",
"--v8-flags=" + v8Flags.join(),
- "runner.ts",
- testCase,
];
+ if (usesNodeTest) {
+ // deno test typechecks by default + we want to pass script args
+ args.push("--no-check", "runner.ts", "--", testCase);
+ } else {
+ args.push("runner.ts", testCase);
+ }
// Pipe stdout in order to output each test result as Deno.test output
// That way the tests will respect the `--quiet` option when provided