admin管理员组文章数量:1303021
I'm trying to fix eslint
warnings in my code and I get a lot of these. The problem is that the files in question are not jest tests but cypress
tests. The tests are valid because cypress
expect
is not the same as jest
expect
.
Is there a way to either ignore the cypress
directory for jest/valid-expect
warnings ? or if that fails just ignore the directory for any jest
validation ? There's no jest
tests in that directory.
I'm trying to fix eslint
warnings in my code and I get a lot of these. The problem is that the files in question are not jest tests but cypress
tests. The tests are valid because cypress
expect
is not the same as jest
expect
.
Is there a way to either ignore the cypress
directory for jest/valid-expect
warnings ? or if that fails just ignore the directory for any jest
validation ? There's no jest
tests in that directory.
- Possible duplicate of stackoverflow./questions/42250257/… – CRayen Commented Oct 2, 2018 at 12:15
- more of a duplicate of this: stackoverflow./questions/41316551/… – xyious Commented Oct 2, 2018 at 15:45
-
1
None of these links really solve the problem tho. We should be able to specify to use the correct
expect
– Anthony Commented May 16, 2022 at 22:23
2 Answers
Reset to default 6This answer provides most of the information needed (thanks CRayen for pointing me to another question (which was a duplicate of another)).
Basically you can put a .eslintrc file into any subfolder in which you want to override rules. Then you need to add a section like the one in the answer:
"overrides": [{
"files": [ "*.spec.js" ],
"rules": {
"no-unused-expressions": 0
}
}]
where you explicitly turn off the rules you don't want to be used to check the files listed by setting them to 0.
Add to the first line in the file:
/* eslint-disable jest/valid-expect */
本文标签: javascriptquottoquot is not a valid property of expect jestvalidexpectStack Overflow
版权声明:本文标题:javascript - "to" is not a valid property of expect jestvalid-expect - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741673846a2391764.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论