Commit 3144adb
committed
fix(test): stop the suite depending on generated Nuxt types
CI ran zero tests: `[TSCONFIG_ERROR] Failed to load tsconfig` for all 10 files,
every suite failed, and it passed locally the whole time.
oxc resolves the nearest tsconfig for each file it transforms. The root
`tsconfig.json` is a project-references stub pointing into `playground/.nuxt/`,
which only exists after `nuxt prepare` — and CI runs `pnpm test` before
`pnpm dev:prepare`, which I ordered that way on purpose so lint and tests fail
fast. Locally a generated `.nuxt` was always lying around, so the dependency was
invisible. Reproduced by moving `playground/.nuxt` aside; it also means `pnpm test`
never worked from a fresh clone.
Turn tsconfig resolution off for the transform instead of reordering CI. Nothing
under test needs tsconfig-driven semantics — no decorators, no path aliases,
relative imports throughout — so the suite becomes hermetic rather than dependent
on a build artefact, which is what a unit test should be.
A scoped `test/tsconfig.json` alone was not enough: it fixed `test/setup.ts` and
then the imported sources failed instead, each resolving the root stub from its own
directory. It stays for editors, which otherwise have no project covering `test/`,
but it is not what the transform reads.
Verified both ways: with `playground/.nuxt` present and absent, 103 tests pass.1 parent e0f902f commit 3144adb
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
4 | 22 | | |
5 | 23 | | |
6 | 24 | | |
| |||
0 commit comments