Answer the question
In order to leave comments, you need to log in
React - how to write tests so that the linter likes them?
Starting to use Jest + Enzyme in react apps.
Wrote a test as in the example, linter (eslint) does not like a lot of places:
What is the best thing to do? Disable linter for test files? Write tests differently somehow?
Answer the question
In order to leave comments, you need to log in
You need to tell the linter that some globals.
Try to specify something like this in the eslint config for tests:
"env": {
"jest": true
}
"env": {
"jest/globals": true
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question