mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
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.
27 lines
735 B
TypeScript
27 lines
735 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { bunEnv, bunExe, normalizeBunSnapshot } from "harness";
|
|
|
|
test("20092", async () => {
|
|
const result = Bun.spawn({
|
|
cmd: [bunExe(), "test", import.meta.dir + "/20092.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/20092.fixture.ts:
|
|
(pass) foo > works
|
|
(pass) bar > works
|
|
|
|
2 pass
|
|
0 fail
|
|
2 expect() calls
|
|
Ran 2 tests across 1 file."
|
|
`);
|
|
});
|