mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
23 lines
669 B
TypeScript
23 lines
669 B
TypeScript
import { test, expect } from "bun:test";
|
|
import { spawnSync } from "bun";
|
|
import { join } from "path";
|
|
import { bunEnv, bunExe } from "harness";
|
|
|
|
test("reportError", () => {
|
|
const cwd = import.meta.dir;
|
|
const { stderr } = spawnSync({
|
|
cmd: [bunExe(), join(import.meta.dir, "reportError.ts")],
|
|
cwd,
|
|
env: {
|
|
...bunEnv,
|
|
// this is default enabled in debug, affects output.
|
|
BUN_JSC_showPrivateScriptsInStackTraces: "0",
|
|
},
|
|
});
|
|
let output = stderr.toString().replaceAll(cwd, "").replaceAll("\\", "/");
|
|
// remove bun version from output
|
|
output = output.split("\n").slice(0, -2).join("\n");
|
|
|
|
expect(output).toMatchSnapshot();
|
|
});
|