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