- 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.
13 lines
456 B
TypeScript
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);
|
|
});
|
|
});
|