-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtsconfig.test.json
More file actions
62 lines (62 loc) · 3.69 KB
/
Copy pathtsconfig.test.json
File metadata and controls
62 lines (62 loc) · 3.69 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
// Type-checks this package's TESTS, which `tsconfig.json` now excludes.
// See `packages/plugin-dashboard/tsconfig.test.json` for the template and
// `packages/types/tsconfig.test.json` for why the exclusion would otherwise
// be a hole: a test nothing compiles can assert a contract the compiler never
// checked and then read as evidence that the contract holds (objectui#3009).
//
// The hole is NEW here, and that is the whole point of objectui#4006. Until
// this file existed these 85 tests were checked — but only as a SIDE EFFECT
// of the build config having no test exclude at all, which is also why 85
// `*.test.d.ts` were emitted into the published `dist/`. Removing the emit
// therefore had to move the coverage in the same commit, not after it:
// scripts/check-type-check-coverage.mjs fails 5c the moment the exclude
// lands alone (measured — it names all 85 files).
//
// Chained from this package's `type-check` script, which is what the CI
// `Type Check` job runs; the coverage gate enforces the chaining — a config
// nothing runs is the objectui#3009 failure itself.
"extends": "../../tsconfig.json",
"compilerOptions": {
// A checking project, never an emitting one. The build config inherits the
// root's `noEmit: true` as well (this package emits `dist` from
// vite-plugin-dts, not from `tsc`), but stating it here is what the gate
// requires and what keeps this project from ever growing an output.
"noEmit": true,
"composite": false,
"declaration": false,
"jsx": "react-jsx",
// Deliberately NOT raised to ES2022. Measured: no test file in this package
// reaches for `Array.prototype.at` or any other ES2021+ builtin, so the
// tests are held to the same lib the shipped SOURCE targets.
"lib": ["ES2020", "DOM", "DOM.Iterable"],
//
// `types` is deliberately NOT named, unlike plugin-dashboard's. Naming it
// switches off automatic `@types/*` inclusion, and this package's build
// program does not name it either — so leaving it unset is what reproduces
// the exact program these tests were checked by until now, which is the
// property objectui#4006 had to preserve while moving the coverage.
// Measured: no test file here uses `global`, and the seven suites that use
// `@testing-library/jest-dom` matchers `import '@testing-library/jest-dom'`
// explicitly, so its global augmentation reaches the whole program through
// that import (plugin-list's lesson).
//
// `paths` drops the root tsconfig's source-tree mappings so `@object-ui/*`
// and `@objectstack/spec/*` resolve through each workspace dependency's
// built `.d.ts` rather than pulling sibling package sources in as program
// inputs. `type-check` dependsOn `^build` (turbo.json), so those `.d.ts`
// exist by the time this runs. This is the one place the project is
// deliberately STRICTER than the program it replaces: the build config
// keeps the root `paths` (and the `rootDir: ".."` that lets sibling sources
// sit inside the root), so until now these tests were checked against
// sibling SOURCE. Checking them against the built declarations is what the
// published contract actually is, and it is what every other chained test
// project in this repo does. Measured: zero new errors either way.
"paths": {}
},
// Only the test files. Note there is no ambient `*.d.ts` under `src/` in this
// package today — if one is ever added it must be NAMED here, because being
// imported is not enough to make an ambient declaration a program input, and
// nothing imports one (plugin-map's lesson, objectui#4270).
"include": ["src/**/*.test.ts", "src/**/*.test.tsx"]
}