blob: e20470f9d62e2386e1ba8b7d00e192da39c9444f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { test, expect } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
// This also tests __dirname and __filename
test("require.cache", () => {
const { stdout, exitCode } = Bun.spawnSync({
cmd: [bunExe(), "run", join(import.meta.dir, "require-cache-fixture.cjs")],
env: bunEnv,
stderr: "inherit",
});
expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
expect(exitCode).toBe(0);
});
|