Files
bun.sh/test/regression/issue/08964/08964.test.ts
pfg 526686fdc9 Prevent test.only and snapshot updates in CI (#21811)
This is feature flagged and will not activate until Bun 1.3

- Makes `test.only()` throw an error in CI
- Unless `--update-snapshots` is passed:
- Makes `expect.toMatchSnapshot()` throw an error instead of adding a
new snapshot in CI
- Makes `expect.toMatchInlineSnapshot()` throw an error instead of
filling in the snapshot value in CI

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-24 15:19:16 -07:00

18 lines
634 B
TypeScript

import { spawnSync } from "bun";
import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "node:path";
test("issue 8964", async () => {
const { exitCode, signalCode, stdout } = spawnSync({
cmd: [bunExe(), "test", join(import.meta.dirname, "08964.fixture.ts")],
env: { ...bunEnv, CI: "false" },
stdio: ["ignore", "pipe", "inherit"],
});
const stdtext = stdout.toString();
const [, actual, expected] = stdout.toString().split("\n");
expect(actual.replace("EXPECTED:", "ACTUAL:")).toBe(expected);
expect(exitCode).toBe(0);
expect(signalCode).toBeUndefined();
});