Skip to content

Commit 7bc0c04

Browse files
committed
test(oxfmt): stop counting both-error conformance cases as passed (#27826)
- Exclude Prettier's `_errors_/` and `range/` fixtures from `js-in-vue` - Rename `issue-19667.ts` to `.tsx` so it parses - Treat both sides failing to parse as a failure
1 parent 03b3f6d commit 7bc0c04

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

apps/oxfmt/conformance/fixtures/edge-cases/css-in-js/issue-19667.ts renamed to apps/oxfmt/conformance/fixtures/edge-cases/css-in-js/issue-19667.tsx

File renamed without changes.

‎apps/oxfmt/conformance/run.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ const categories: Category[] = [
4444
{
4545
name: "js-in-vue",
4646
sources: [
47-
{ dir: join(EXTERNALS_DIR, "prettier"), ext: ".vue" },
47+
{
48+
dir: join(EXTERNALS_DIR, "prettier"),
49+
ext: ".vue",
50+
// Parser error messages and range formatting are not formatter concerns
51+
excludes: ["/_errors_/", "vue/range/"],
52+
},
4853
{ dir: join(EXTERNALS_DIR, "vue-vben-admin"), ext: ".vue" },
4954
{ dir: join(FIXTURES_DIR, "edge-cases", "js-in-vue") },
5055
],
@@ -381,7 +386,8 @@ async function runCategory(category: Category, fixtures: Fixture[]): Promise<Cat
381386
options,
382387
);
383388

384-
if (oxfmtResult === prettierResult) {
389+
// Both failing to parse is not a pass, the fixture exercised nothing
390+
if (oxfmtResult === prettierResult && oxfmtResult !== "ERROR") {
385391
passed++;
386392
} else {
387393
failures.push({

‎apps/oxfmt/conformance/snapshots/conformance.snap.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## js-in-vue
22

3-
### Option 1: 424/427 (99.30%)
3+
### Option 1: 421/424 (99.29%)
44

55
```json
66
{"printWidth":80}
@@ -13,7 +13,7 @@
1313
- [externals/vue-vben-admin/effects/common-ui/src/components/api-component/api-component.vue](diffs/js-in-vue/externals__vue-vben-admin__effects__common-ui__src__components__api-component__api-component.vue.md)
1414
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#ts-in-vue-generic-trailing-comma
1515

16-
### Option 2: 425/427 (99.53%)
16+
### Option 2: 422/424 (99.53%)
1717

1818
```json
1919
{"printWidth":100,"vueIndentScriptAndStyle":true,"singleQuote":true}

0 commit comments

Comments
 (0)