I spent forever trying to figure it out and no answers that I could find helped me out.
Upgrading "@testing-library/jest-dom" from 5 to 6 did fix this problem, but it caused a lot of test failures in code that I don't know well and I didn't want to tackle that.
The solution that I found was to run "pnpm add -D @types/testing-library__jest-dom" to add types (not needed in version 6, but needed in version 5). This did absolutely nothing.
Finally I looked at the node folder and saw that version 6 of @types/testing-library__jest-dom was a no-op stub. So I ran "pnpm add -D @types/testing-library__jest-dom@5" and boom, problem solved!