mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
f87b33464d
- 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
24 lines
797 B
TypeScript
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);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|