Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

组件测试-更多 Matchers,types 添加 @testing-library/jest-dom 报错 #26

Closed
zhengbangbo opened this issue Jun 10, 2022 · 1 comment

Comments

@zhengbangbo
Copy link
Contributor

跟随教程练习,tsconfig.json 中 types 添加 @testing-library/jest-dom 报错:

Entry point of type library '@testing-library/jest-dom' specified in compilerOptions

查询后找到 testing-library/jest-dom#123 (comment)

  1. Add @types/testing-library__jest-dom to @testing-library/jest-dom dependencies
  2. Add testing-library__jest-dom to DefinitelyTyped

按照这两条指示,测试运行成功。

这是我的 commit

@haixiangyan
Copy link
Owner

我 checkout 到这个 commit,使用 npm 安装,去掉 @testing-library_jest-dom 的一些配置,发现没有这个报错诶。目前还没想明白是什么原因,我在文档里加个 Hint,导到这个 Issue 上吧。

haixiangyan added a commit that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants