mirror of
https://github.com/hanzo-apps/tabs.git
synced 2026-10-30 15:04:29 +00:00
Three defects arrived together with the toolchain versions, and each hid the next. ts-jest reads the TypeScript compiler's JavaScript API, which TypeScript 7 does not expose. With `typescript` pinned to 7.0.2 every suite failed to LOAD, so `jest` reported zero tests and exited as though there were none to run. ts-jest states the limit itself — `typescript: >=4.3 <7` — and its newest release is still 29. next/jest replaces it, using the SWC that next already ships: no second toolchain, and no native binary behind an install script this repo's supply-chain policy blocks. TypeScript 7 also does not discover @types through pnpm's symlinked node_modules/@types, so every `describe`, `it` and `expect` in tests/ was an unresolved global — 283 of the 284 errors the project reported. Naming them in `types` fixes it. A .tsbuildinfo from before the bump made the count identical either way, which is why clearing it was part of finding this at all. That left one real error: Chip spread Stack props onto a Button, and @hanzo/ui redeclares `onClick` as the DOM handler a web caller actually writes. A Chip is a Button, so its extra props are a Button's — which carry every layout prop anyway, through the gui Frame it is built from. `pnpm install` still exits non-zero over two unapproved build scripts, which is true of this branch without any of these changes and is a decision to make rather than a thing to work around. Co-authored-by: Hanzo Dev <[email protected]>
24 lines
1.2 KiB
JavaScript
24 lines
1.2 KiB
JavaScript
/** Pure logic only: the layout tree and the shell bindings. Everything that
|
|
* needs a browser is verified against a real one, not simulated here.
|
|
*
|
|
* Transformed by next/jest, which uses the SWC that `next` already ships — so
|
|
* there is no second toolchain to install and no native binary behind an
|
|
* install script this repo's supply-chain policy blocks.
|
|
*
|
|
* It replaced ts-jest, which reads the TypeScript compiler's JavaScript API.
|
|
* TypeScript 7 does not expose that API, so with `typescript` pinned to 7.0.2
|
|
* every suite here failed to LOAD and `jest` reported zero tests rather than a
|
|
* failure. ts-jest states the limit itself — `typescript: >=4.3 <7` — and its
|
|
* newest release is still 29.
|
|
*
|
|
* Types are checked by `tsc --noEmit`, which is the job the type checker has.
|
|
* A test run that also type-checks ties what the tests can do to which
|
|
* compiler is pinned, and that is exactly how a version bump silenced them. */
|
|
const nextJest = require('next/jest');
|
|
|
|
module.exports = nextJest({ dir: __dirname })({
|
|
testEnvironment: 'node',
|
|
testMatch: ['<rootDir>/tests/**/*.test.ts'],
|
|
moduleNameMapper: { '^@/(.*)$': '<rootDir>/$1' },
|
|
});
|