Expect.extend doesn`t work. TypeError: Cannot convert undefined or null to object [closed]
Asked Answered
F

0

8

I made the same settings for running vitest like in this article: https://medium.com/@zamin_mirzad/how-to-setup-vite-js-react-js-typescript-vitest-js-6e01b6436c6a

But when I run yarn test I have this issue https://i.sstatic.net/4s5Ae.png

And it can`t find any matchers https://i.sstatic.net/IJlRc.png

Please, help me!) Maybe I need something to the config?

Forestry answered 13/12, 2023 at 17:47 Comment(3)
Hi. Welcome to SO! Please read how to ask and try to provide a Minimum Reproducible Example. The first step here would be to provide your code instead of pictures of your codeVastha
I was also debugging the same issue, google search for the error landed me here. The import in the medium article needs slight modification where you need to import * as matchers from "@testing-library/jest-dom/matchers"; instead of import matchers from "@testing-library/jest-dom/matchers"; as suggested. This is highlighted in issue 439 herePoohpooh
The above should be an answer and marked as correctFirecracker

© 2022 - 2024 — McMap. All rights reserved.