[英]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.