简体   繁体   English

ESLint 报告“在@testing-library/vue 中找不到屏幕”

[英]ESLint reports "screen not found in @testing-library/vue"

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" .我正在尝试使用@testing-library/vue并导入 screen 方法,ESLint 报告以下错误: "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.我认为这是因为@testing-library/vue重新导出了@testing-library/dom方法,但我认为 ESLint 能够接受它。

tsconfig.json中的types数组中添加了"@testing-library/vue" ,它现在可以工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ReactJS:无法加载在“package.json”中声明的插件“testing-library”:找不到模块“./eslint-utils” - ReactJS : Failed to load plugin 'testing-library' declared in 'package.json : Cannot find module './eslint-utils' useFakeTimers 在玩笑/测试库中不起作用 - useFakeTimers not working in jest/testing-library 测试库自定义查询打字稿错误 - Testing-library custom query Typescript error 如何使用 Cypress 和 @testing-library/cypress 测试复选框切换, - How to test checkbox toggle with Cypress and @testing-library/cypress , 有没有办法关闭测试库中的语法突出显示 - Is there a way to turn off syntax highlighting in testing-library 用testing-library在JS中模拟长按鼠标左键 - Simulating a long press of mouse left button in JS with testing-library 使用 fireEvent 传递自定义事件属性(testing-library 和 jest) - pass custom event properties with fireEvent (testing-library and jest) @testing-library/react 中的 toBeInTheDocument 和 getBy* 有什么区别 - Whats the difference between toBeInTheDocument and getBy* in @testing-library/react 测试库反应模拟 function 与回调将设置 state 返回 - testing-library react mock function with callback that will set state on return 使用@testing-library/user-event 进行虚假点击 - Fake click using @testing-library/user-event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM