|
| 1 | +{ |
| 2 | + // Type-checks this package's TESTS, which `tsconfig.json` excludes. |
| 3 | + // See `packages/types/tsconfig.test.json` for why that exclusion was a hole: |
| 4 | + // the build correctly keeps tests out of `dist`, but nothing else compiled |
| 5 | + // them, so a test could assert a contract the compiler never checked. |
| 6 | + "extends": "../../tsconfig.json", |
| 7 | + "compilerOptions": { |
| 8 | + "noEmit": true, |
| 9 | + // The package build emits `dist`; this project emits nothing, so it must |
| 10 | + // not inherit `composite` / `declaration` from the build config. |
| 11 | + "composite": false, |
| 12 | + // The `toBeInTheDocument` / `toHaveTextContent` matchers these tests use are |
| 13 | + // a global augmentation, not an import, and `@testing-library/jest-dom` does |
| 14 | + // not live under `@types/` — so it is never picked up automatically and has |
| 15 | + // to be named here. Naming `types` at all switches off automatic `@types/*` |
| 16 | + // inclusion, which is fine: nothing in these tests touches Node globals. |
| 17 | + "types": ["@testing-library/jest-dom"], |
| 18 | + // Drop the root tsconfig's source-tree `paths` so `@object-ui/*` and |
| 19 | + // `@objectstack/spec` resolve through the workspace dependency's built |
| 20 | + // `.d.ts` instead of pulling sibling sources in as program inputs (TS6059). |
| 21 | + "paths": {} |
| 22 | + }, |
| 23 | + // `src/global.d.ts` is pulled in explicitly. The build program gets it for |
| 24 | + // free from `"include": ["src"]`, but an ambient declaration file is only a |
| 25 | + // program input when a pattern names it — being imported is not enough, |
| 26 | + // because nothing imports it. Without it `ObjectMap.tsx`'s side-effect import |
| 27 | + // of `maplibre-gl/dist/maplibre-gl.css` is TS2882 here and nowhere else, |
| 28 | + // which reads as a defect in the source the build compiles cleanly. |
| 29 | + "include": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/**/*.d.ts"] |
| 30 | +} |
0 commit comments