Eslint Reports“屏幕”在 @testing-library/vue中找不到屏幕。

发布于 2025-02-10 01:21:00 字数 413 浏览 0 评论 0原文

我正在尝试使用@testing-library/vue并导入屏幕方法,ESLINT报告了以下错误:“在 @testing-library/vue中找不到屏幕”

// The render function doesn't error but screen yes
import { render, screen } from '@testing-library/vue';

有人以前遇到过这个问题吗?我认为这是由于@testing-library/vue re-Exports @testing-library/dom方法,但我认为Eslint能够捡起它。

I'm trying to use @testing-library/vue and import the screen method and ESLint reports the following error: "screen not found in @testing-library/vue".

// The render function doesn't error but screen yes
import { render, screen } from '@testing-library/vue';

Anyone came across this issue before? I think it's due to the fact that @testing-library/vue re-exports @testing-library/dom methods but I supposed that ESLint was able to pick that up.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔芯 2025-02-17 01:21:00

添加了“@test-library/vue”到我的types 内部tsconfig.json,现在可以使用。

Added "@testing-library/vue" to my types Array inside tsconfig.json and it now works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文