Add isWindows and related helpers to test harness

This commit is contained in:
Ashcon Partovi
2024-02-05 12:47:52 -08:00
parent 51def5f5d6
commit 264142e756
18 changed files with 81 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
import { expect, test } from "bun:test";
import { bunEnv, bunExe, ospath } from "harness";
import { bunEnv, bunExe, isWindows, ospath } from "harness";
import { _nodeModulePaths, builtinModules, isBuiltin, wrap } from "module";
import Module from "module";
import path from "path";
@@ -36,7 +36,7 @@ test("module.Module works", () => {
});
test("_nodeModulePaths() works", () => {
const root = process.platform === "win32" ? "C:\\" : "/";
const root = isWindows ? "C:\\" : "/";
expect(() => {
_nodeModulePaths();
}).toThrow();