Tags

,

Problem:
'describe' is not defined. eslint no-undef
Solution:
In .eslintrc add this code jest/globals=true, for example:

"env": {
"browser": true,
"es6": true,
"node": true,
"jest/globals": true
},


Problem:
How to run 1 single test file in react Jest?
Solution:
In package.json we just add the relative path of the test/spec file. For example:
"scripts": {
"test": "jest --coverage src/components/Page.spec.js"
}