build: upgrade jest to 30 - #3413
Conversation
jest/jest-environment-jsdom 29.6.4 -> 30.x, babel-jest 29.6.4 -> 30.4.1, ts-jest -> ^29.4.12 (supports jest 30; ts-jest 30 unpublished). Pulls in jsdom 26. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop jest-environment-jsdom-global (unused; peer capped at jest 29), @testing-library/react-hooks (unused; renderHook comes from RTL), and mutationobserver-shim (jsdom 26 has native MutationObserver). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@testing-library/jest-dom ^5.16 -> ^7 and @testing-library/dom ^8 -> ^10 to align with jest 30 / RTL 15 / jsdom 26 (jest-dom v7 requires node 22). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The jest global types (describe/it) were only present transitively before; removing the unused deps dropped @types/jest, breaking tsconfig types:[jest]. Pin it explicitly at ^30 to match jest 30. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jest 30 removed the alias matchers. toBeCalled -> toHaveBeenCalled and lastCalledWith -> toHaveBeenLastCalledWith across Disclosure, GridForm, and useDebouncedField tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The single-view config disabled the next CTA (last view), so jest-dom v7's accurate toHaveStyle read the disabled background. Add a second view so the next button is enabled and its primary variant is actually asserted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jest 30 changed the snapshot header URL (goo.gl -> jestjs.io); no content drift. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 3fb3319 ☁️ Nx Cloud last updated this comment at |
|
| { | ||
| title: 'Multi view', | ||
| children: <>View 2</>, | ||
| primaryCta: { actionType: 'confirm', children: 'Done' }, | ||
| secondaryCta: { | ||
| actionType: 'cancel', | ||
| children: 'Cancel', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
this seems out of place, why did this need to change?
There was a problem hiding this comment.
oh! it was a real test failure where the next button was disabled bc it was testing multiview with only one view. selling the jest bump with this one example!
Jest 30 loads .ts configs as native ESM on Node >=22.18/23.6/24 (process.features.typescript), where the configs' extensionless base import and __dirname break. Pin the ts-node/CJS loader via the @jest-config-loader pragma so config loading is consistent across Node versions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
📬 Published Alpha Packages:
|
|
🚀 Styleguide deploy preview ready! Preview URL: https://6a8c5241e974dedaae3dd8c3--gamut-preview.netlify.app |
LinKCoding
left a comment
There was a problem hiding this comment.
Tests are passing and type checking looks good!


Overview
Bumps the Jest core family to v30 (from v29) across the monorepo, along with the companion updates required to keep the test suite green on the new major.
Changes
jest,jest-cli,jest-config,jest-environment-jsdom, and related core packages to v30.@testing-library/*to versions compatible with Jest 30 / jsdom 26.@types/jest(no longer bundled the way v29 provided it).jest-environment-jsdom-global(peer-capped at jest 29),@testing-library/react-hooks(renderHook now comes from RTL), andmutationobserver-shim(jsdom 26 has native MutationObserver)./** @jest-config-loader ts-node */pragma to all 9 packagejest.config.tsfiles (see below).Why the config-loader pragma
Jest 30 changed how it loads
.tsconfig files: on Node versions with native TypeScript support (process.features.typescript, default-on in Node ≥ 22.18 / 23.6 / 24) it loads the config as native ESM instead of via ts-node/CJS.Our package configs rely on CJS-only idioms — an extensionless
import base from '../../jest.config.base'and__dirnameinjest.config.base.ts— which are illegal under ESM. The result was a hard split:^22.13.1) → ts-node/CJS path → tests pass.Jest: Failed to parse the TypeScript config file … ERR_MODULE_NOT_FOUND: Cannot find module '…/jest.config.base'.The
@jest-config-loader ts-nodepragma forces the ts-node/CJS loader on all Node versions, making config loading consistent for everyone without rewriting the configs to be ESM-native (which would have required dropping ts-node and bumping the pinned Node).PR Checklist
Testing instructions
Expected: all 9 projects green (1587 tests pass, 0 fail), typecheck clean, and a clean working tree afterward (no snapshot churn).
PR Links and Envs