Files
bun.sh/test/regression/issue/19875.test.ts
pfg 5e8feca98b Enable breaking_changes_1_3 (#23308)
Breaking changes:

- bun:test: disallow creating snapshots or using .only() in ci
- for users: hopefully this should only reveal existing bugs in tests,
not cause failures.
- general: enable calling unhandled rejection handlers for
ErrorBuilder.reject()
- for users: this might reveal some unhandled rejections that were not
visible before.
2025-10-07 12:07:29 -07:00

26 lines
708 B
TypeScript

import { expect, test } from "bun:test";
import { bunEnv, bunExe, normalizeBunSnapshot } from "harness";
test("19875", async () => {
const result = Bun.spawn({
cmd: [bunExe(), "test", import.meta.dir + "/19875.fixture.ts"],
stdout: "pipe",
stderr: "pipe",
env: { ...bunEnv, CI: "false" }, // tests '.only()'
});
const exitCode = await result.exited;
const stdout = await result.stdout.text();
const stderr = await result.stderr.text();
expect(exitCode).toBe(0);
expect(normalizeBunSnapshot(stderr)).toMatchInlineSnapshot(`
"test/regression/issue/19875.fixture.ts:
(todo) only > todo > fail
0 pass
1 todo
0 fail
Ran 1 test across 1 file."
`);
});