I needed to add a jest-setup.ts
with the import '@testing-library/jest-dom'
to make the test runner happy.
The missing piece for my IDE (Rider) was to add that jest-setup.ts
to the include
array in my tsconfig.json
:
"include": ["src/**/*", "jest-setup.ts"]
as documented here: https://github.com/testing-library/jest-dom?tab=readme-ov-file#with-typescript