Skip to content

chore(deps-dev): migrate to Jest 30#94

Merged
pmigueld merged 2 commits into
developfrom
chore/jest-30-migration
Jul 24, 2026
Merged

chore(deps-dev): migrate to Jest 30#94
pmigueld merged 2 commits into
developfrom
chore/jest-30-migration

Conversation

@pmigueld

Copy link
Copy Markdown
Contributor

Migrates all 5 Jest packages (datacollect, backend, adapter-mock/openfn/openspp) to Jest 30 (supersedes dependabot #73 and #89). A migration, not a plain bump.

Changes

  • jest ^29.7.0→^30.0.0, @types/jest ^29.5.14→^30.0.0 (all 5); jest-environment-jsdom→^30.0.0 (datacollect). ts-jest kept at ^29.4.11 (supports jest 30).
  • Removed the abandoned jest-fetch-mock (breaks on jest 30's native fetch) from all 5 configs + package.json. No fetch-mock code changes needed: its global was never actually enabled (enableMocks() was never called), and the two fetch-touching datacollect tests already use jest-native global.fetch = jest.fn().

Fallout from jest-30/jsdom-30 (assertions preserved)

  • jsdom 30 makes window a non-configurable getter → the Auth0/Keycloak adapter tests (which fake global.window to test frontend/backend detection, no real DOM) moved to @jest-environment node + configurable: true. Same assertions.
  • expect@30 toThrow now enforces the thrown error's class. EntityDataManager.test.ts expected an AppError that the code never actually throws — EventApplierService throws a plain Error and EntityDataManager.submitForm passes it through unwrapped (verified: no SUBMIT_FORM_ERROR exists in the codebase). Corrected the expectation to new Error(<same message>), preserving the message check jest 29 performed.

Verification

datacollect 857 (801 pass/56 skip), backend 421 (vs Postgres), adapter-openspp 140, adapter-openfn 27, adapter-mock 53 — all match baseline.

🤖 Generated with Claude Code

@pmigueld
pmigueld force-pushed the chore/jest-30-migration branch from fcbf5c8 to 4ffd275 Compare July 24, 2026 07:57
@pmigueld
pmigueld merged commit 615f810 into develop Jul 24, 2026
9 checks passed
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.

1 participant