mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
18 lines
577 B
TypeScript
18 lines
577 B
TypeScript
import { spawnSync } from "bun";
|
|
import { expect, test } from "bun:test";
|
|
import { bunExe, bunEnv as env } from "harness";
|
|
|
|
test("--no-addons throws an error on process.dlopen", () => {
|
|
const { stdout, stderr, exitCode } = spawnSync({
|
|
cmd: [bunExe(), "--no-addons", "-p", "process.dlopen()"],
|
|
env,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
});
|
|
const err = stderr.toString();
|
|
const out = stdout.toString();
|
|
expect(exitCode).toBe(1);
|
|
expect(out).toBeEmpty();
|
|
expect(err).toContain("\nerror: Cannot load native addon because loading addons is disabled.");
|
|
});
|