Skip to content

build: bump Jest - #3413

Draft
aresnik11 wants to merge 7 commits into
mainfrom
ajr-bump-jest
Draft

build: bump Jest#3413
aresnik11 wants to merge 7 commits into
mainfrom
ajr-bump-jest

Conversation

@aresnik11

@aresnik11 aresnik11 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Overview

Bumps Jest from 29.6.430.x across the gamut monorepo, refreshes the testing-library family to match, and removes some dead jest-related deps. All tests and typechecks pass.

Landed as focused commits:

Commit What
Bump jest core family to v30 jest/jest-environment-jsdom → 30.x, babel-jest → 30.4.1, ts-jest^29.4.12 (supports jest 30; ts-jest 30 isn't published yet). Pulls in jsdom 26.
Remove unused jest deps jest-environment-jsdom-global (peer capped at jest 29, unused), @testing-library/react-hooks (unused — renderHook comes from RTL), mutationobserver-shim (jsdom 26 has native MutationObserver)
Refresh testing-library for jest 30 @testing-library/jest-dom ^5^7, @testing-library/dom ^8^10
Add explicit @types/jest ^30 — jest global types were only present transitively before
Replace removed jest matcher aliases toBeCalledtoHaveBeenCalled, lastCalledWithtoHaveBeenLastCalledWith
Fix Modal primary-variant test for jest-dom v7 Give the test a non-last view so the Next button is actually enabled
Update snapshot headers for jest 30 goo.gljestjs.io header URL; no content drift

Breaking changes addressed

  • Removed expect matcher aliases — jest 30 deleted them; migrated toBeCalled/lastCalledWith.
  • jsdom 21 → 26 — validated getComputedStyle canary tests and timer/rAF-heavy suites; no regressions.
  • jest-dom v5 → v7 — v7 computes styles more accurately, which exposed one latent false-positive test (see notes).
  • Snapshot header URL change — regenerated (metadata only).

Prerequisites (already satisfied — no work needed)

  • Node ^22.13.1 — jest 30 dropped 14/16/19/21.
  • TypeScript 5.9.3 — above jest 30's new 5.4 minimum.
  • @nx/jest@22.6.0 already resolves jest 30 internals.

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-237
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing instructions

# Install the updated deps
yarn install

# Run the full test suite across all projects
yarn test
# (equivalently: yarn nx run-many --target=test --all)

# Typecheck
yarn verify

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

Repository PR Link
Monolith Monolith PR
Mono Mono PR

aresnik11 and others added 7 commits August 18, 2026 09:32
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>
@nx-cloud

nx-cloud Bot commented Aug 18, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit c0e725e


☁️ Nx Cloud last updated this comment at 2026-08-18 14:21:55 UTC

@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 72.5.4-alpha.30b247.0 npm diff
@codecademy/gamut-icons 9.57.12-alpha.30b247.0 npm diff
@codecademy/gamut-illustrations 0.58.17-alpha.30b247.0 npm diff
@codecademy/gamut-kit 3.0.17-alpha.30b247.0 npm diff
@codecademy/gamut-patterns 0.10.36-alpha.30b247.0 npm diff
@codecademy/gamut-styles 20.1.1-alpha.30b247.0 npm diff
@codecademy/gamut-tests 6.0.7-alpha.30b247.0 npm diff
@codecademy/variance 0.26.2-alpha.30b247.0 npm diff
eslint-plugin-gamut 2.4.4-alpha.30b247.0 npm diff

@github-actions

Copy link
Copy Markdown
Contributor

@aresnik11 aresnik11 changed the title Ajr bump jest build: bump Jest Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants