react-testing-library why is toBeInTheDocument() not a function

后端 未结 5 1116
别跟我提以往
别跟我提以往 2021-02-11 15:35

Here is my code for a tooltip that toggles the CSS property display: block on MouseOver and on Mouse Out display: none.

 it(\'should sho         


        
5条回答
  •  悲&欢浪女
    2021-02-11 15:42

    When you do npm i @testing-library/react make sure there is a setupTests.js file with the following statement in it

    import '@testing-library/jest-dom/extend-expect';

提交回复
热议问题