Skip to content

Update test tooling to Vitest 5, jsdom 30 and Testing Library 16 - #1381

Merged
microbit-matt-hillsdon merged 1 commit into
mainfrom
deps-jsdom-30-vitest-5
Oct 29, 2026
Merged

microbit-matt-hillsdon merged 1 commit into
mainfrom
deps-jsdom-30-vitest-5

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator
  • vitest 4 → 5, jsdom 28 → 30
  • @testing-library/react 14 → 16 (with @testing-library/dom 10 as its peer), @testing-library/jest-dom 5 → 7, @testing-library/user-event latest 14
  • Testing Library was in both dependencies and devDependencies; it's now dev only
  • setupTests.ts imports @testing-library/jest-dom/vitest and drops the explicit cleanup, which Testing Library registers itself with globals: true
  • jest-dom 7 no longer brings in @types/jest, so tsconfig.json takes vitest/globals

Part of using jsdom 30 as the one test DOM across the Foundation's repos (microbit-foundation/microbit-org#333, microbit-foundation/ui#187).

Checked locally: 338 tests pass, as before; typecheck, lint and Prettier are clean.

Testing Library was listed in both dependencies and devDependencies; it
is now dev only, with @testing-library/dom 10 added as react 16's peer.
jest-dom 7 registers its matchers through @testing-library/jest-dom/vitest
and no longer brings in @types/jest, so tsconfig takes vitest/globals.
Testing Library cleans up after each test itself when globals are on.
@microbit-matt-hillsdon microbit-matt-hillsdon added the dependencies Pull requests that update a dependency file label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

Preview build will be at
https://review-python.microbit.org/deps-jsdom-30-vitest-5/

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit 81d1c1e into main Oct 29, 2026
3 checks passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the deps-jsdom-30-vitest-5 branch October 29, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant