test: remove dead no-models.yaml fixture - #208
Merged
Merged
Conversation
tests/inputs/no-models.yaml is unreferenced and broken. Its only consumer was the "createImports (No models)" test, which was already disabled with "Skip: no-models.yaml causes upstream @hey-api/openapi-ts error" before tests/createImports.test.ts was deleted in 606ec44. The fixture was also misnamed: back when the test still ran, it asserted that "../requests/types.gen" WAS among the imports, so the spec produced a types.gen file anyway and never reproduced a missing-models condition. No references remain in tests, package.json scripts, vitest.config.ts, or CI workflows, and no test enumerates tests/inputs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Deletes
tests/inputs/no-models.yaml.Why
The fixture is dead and broken:
grep -rn "no-models"across the repo returns zero hits — no test passes it togenerateTSClients(prefix, inputFile)(tests/utils.ts:8). The other fixtures (petstore.yaml,dates.yaml,string-pagination.yaml) are all actively used.createImports (No models)test was removed along with all oftests/createImports.test.tsin 606ec44 (refactor: migrate code generation to a ts-morph pipeline).Support TypeScript5.9.x and hey-api/openapi-ts 0.92.x (#192)) the test read// Skip: no-models.yaml causes upstream @hey-api/openapi-ts error/test.skip(...). We are now on@hey-api/openapi-ts0.99.0, so the fixture almost certainly still fails to generate."../requests/types.gen"was among the imports, and that import was pushed only insideif (modelsFile). So the spec produced atypes.genfile regardless — it never reproduced a "models file missing" condition. It should not be resurrected for that purpose.Verification
package.jsonscripts,vitest.config.ts, or.github/workflows/(test.yml,release.yml).tests/inputsviareaddir/glob. Every hit forinputsundertests/ispath.join(__dirname, "inputs", <literal>)withpetstore.yamlordates.yaml. The onlyreaddirSyncinsrc/is the tsconfig lookup insrc/generate.mts:23, which is unrelated.tests/__snapshots__/holds onlycreateSource.test.ts.snapandgenerate.test.ts.snap, both matching live test files.Test results
Under identical conditions (example codegen not yet run), the suite is unchanged: 188 passed before, 188 passed after. After reproducing the CI setup (
pnpm -w build+pnpm --filter @7nohe/react-app generate:api), the full suite is green: 16 files / 194 tests passed — the extra 6 come fromexamples/react-app/verify-runtime.test.tsbecoming loadable once the generated client exists, not from this change.One full run showed 2 transient failures in
tests/parseOperations.test.tsduring a slow, heavily loaded run (37s vs the usual 19s). It did not reproduce in 3 isolated runs of that file (11/11 each) or 3 further full-suite runs, and the deleted fixture is referenced by nothing, so it cannot be causal there.