Files
oxc-project__oxc/apps/oxfmt/test/cli/cli.test.ts
leaysgur f87b33464d test(oxfmt): Refactor test fixtures usage (#21494)
- Normalized tests that were ambiguous as to whether they were fixtures or scenarios based
- Specified this rule in AGENTS.md
- Made the test name report in the CLI clearer
2026-04-16 09:40:58 +00:00

24 lines
797 B
TypeScript

import { join } from "node:path";
import { describe, it } from "vitest";
import { getFixtures, runFixture } from "./utils";
// oxlint-disable valid-title
describe("oxfmt CLI", () => {
const fixtures = getFixtures();
for (const fixture of fixtures) {
// Concurrent across fixtures, sequential within (file writes may conflict)
describe.concurrent(fixture.name, () => {
for (let i = 0; i < fixture.testCases.length; i++) {
const testCase = fixture.testCases[i];
it.sequential(`${fixture.name}/${i}`, async ({ expect }) => {
const snapshotPath = join(fixture.dirPath, `${i}.snap.md`);
const snapshot = await runFixture(fixture, testCase);
await expect(snapshot).toMatchFileSnapshot(snapshotPath);
});
}
});
}
});