mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* make our debug assertions work * install bun-webkit-debug * more progress * ok * progress... * more debug build stuff * ok * a * asdfghjkl * fix(runtime): fix bad assertion failure in JSBufferList * ok * stuff * upgrade webkit * Update src/bun.js/bindings/JSDOMWrapperCache.h Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * fix message for colin's changes * okay * fix cjs prototype * implement mainModule * i think this fixes it all --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
28 lines
829 B
TypeScript
28 lines
829 B
TypeScript
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()).toEndWith("--pass--");
|
|
expect(exitCode).toBe(0);
|
|
});
|
|
|
|
// https://github.com/oven-sh/bun/issues/5188
|
|
test("require.cache does not include unevaluated modules", () => {
|
|
const { stdout, exitCode } = Bun.spawnSync({
|
|
cmd: [bunExe(), "run", join(import.meta.dir, "require-cache-bug-5188.js")],
|
|
env: bunEnv,
|
|
stderr: "inherit",
|
|
});
|
|
|
|
expect(stdout.toString().trim()).toEndWith("--pass--");
|
|
expect(exitCode).toBe(0);
|
|
});
|