Files
oh-my-pi/packages/react-edit-benchmark/test/formatter.test.ts
T
can1357 3e90682970 feat(react-edit-benchmark): enhanced error messages with mutation previews and improved file verification
- Added mutation preview hints to error messages when edits fail with 'No changes made' errors, showing line numbers, hashes, and added/removed lines.
- Changed formatter to pin JavaScript fixtures to the flow parser to avoid parser-dependent formatting drift.
- Added whitespace preservation logic to treat whitespace-only differences as passing in file verification.
2026-02-11 08:12:07 +01:00

13 lines
456 B
TypeScript

import { describe, expect, it } from "bun:test";
import { formatContent } from "../formatter";
describe("formatContent", () => {
it("pins .js files to the flow parser (no fallback to babel-ts)", async () => {
const tsOnlySyntaxInJs = "namespace Foo { export const value = 1; }\n";
const result = await formatContent("fixture.js", tsOnlySyntaxInJs);
expect(result.didFormat).toBe(false);
expect(result.formatted).toBe(tsOnlySyntaxInJs);
});
});