Files
bun.sh/test/cli/run/commonjs-no-export.test.ts
Jarred Sumner 7d94a49ef4 Fix bug that breaks bunx prisma init when node is not installed (#3362)
* tweak cjs

* Handle more cases, add a test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-19 22:34:22 -07:00

15 lines
454 B
TypeScript

import { test, expect } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
test("CommonJS entry point with no exports", () => {
const { stdout, exitCode } = Bun.spawnSync({
cmd: [bunExe(), "run", "--bun", join(import.meta.dir, "commonjs-no-exports-fixture.js")],
env: bunEnv,
stderr: "inherit",
});
expect(stdout.toString().trim().endsWith("--pass--")).toBe(true);
expect(exitCode).toBe(0);
});