我试图在测试库中使用用户事件实用程序,如下所述:
https://testing-library.com/docs/user-event/intro
不幸的是,当我尝试调用安装函数时
userEvent.setup()我的IDE说找不到它:

为什么会发生这种情况?
我在文件中的输入如下所示:
import userEvent from '@testing-library/user-event'我的包依赖关系如下所示:
"@testing-library/dom": "^8.11.3",
"@testing-library/jest-dom": "5.7.0",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^13.5.0",https://stackoverflow.com/questions/72186021
复制相似问题