-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtsconfig.test.json
More file actions
45 lines (45 loc) · 2.58 KB
/
Copy pathtsconfig.test.json
File metadata and controls
45 lines (45 loc) · 2.58 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
// 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.
//
// This project is now the ONLY one that compiles `spec-symbol-batch7.test.tsx`,
// whose whole value is compile-time assertions (objectui#3181). It used to be
// rescued by a narrow `tsconfig.typetests.json` next door, which named that one
// file while the rest of the tree was still in TEST_DEBT; the package graduated
// in objectui#4040 and the narrow project was retired in objectui#4291, after
// `--listFiles` showed this project reads the same file and a provably-false
// `Assert` appended to it turned this project red. Keep the file compiling
// here: those assertions are erased at runtime, so vitest proves nothing
// about them and `tsc` is the only thing that can.
"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,
"jsx": "react-jsx",
"lib": ["ES2020", "DOM"],
// Two global augmentations, neither of them an import:
// - `node` for `spec-symbol-batch7.test.tsx`, which resolves
// `@objectstack/spec`'s own `.d.ts` off disk to read the spec's export
// names through the TypeScript checker.
// - `@testing-library/jest-dom` for the `toBeInTheDocument` /
// `toHaveTextContent` matchers across the `.tsx` suites; it does not
// live under `@types/`, so it is never picked up automatically.
// Naming `types` at all switches off automatic `@types/*` inclusion, so
// both have to be listed here.
"types": ["node", "@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": {}
},
// No `src/**/*.d.ts` entry, unlike plugin-map's project: this package keeps no
// ambient declaration files, so there is nothing for such a pattern to name.
// Add it here the moment one appears — an ambient declaration is a program
// input only when a pattern NAMES it, and the build gets that for free from
// its `"include": ["src"]` while this project would not.
"include": ["src/**/*.test.ts", "src/**/*.test.tsx"]
}