There is a typo error in the jest.config.js file, where the property setupFilesAfterEnv has a path that looks for setupTestS.js (plural) and you are instructing to create a file callled setupTest.js (singular) which will cause a not found option when starting the test.
Also, I you already have taken time -thank you- for writing this post, I'd also given some guidance to setup the Babel which is quite simple: babeljs.io/setup#installation -> in babel.config.json add {
"presets": [["@babel/preset-env"], ["@babel/preset-react"]]
} and done. Otherwise some people will be stuck right after trying to run the first and simplest test.
Hi, thanks for your feedback! I cannot spot the typo you are talking about 🤔. I see setupTests.js everywhere.
Babel configuration is out of the scope of the article because it's something about project configuration but it's probably useful to remind readers to install @babel/core @babel/preset-env @babel/preset-react and add a babel.config.json like the one you suggested.
Yeah... it might have been my own typo, since I never copy/paste code. Thanks for clearing out the very basics for the babel.config.json file. Keep it up!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There is a typo error in the
jest.config.js
file, where the propertysetupFilesAfterEnv
has a path that looks forsetupTestS.js
(plural) and you are instructing to create a file callledsetupTest.js
(singular) which will cause anot found option
when starting the test.Also, I you already have taken time -thank you- for writing this post, I'd also given some guidance to setup the
Babel
which is quite simple: babeljs.io/setup#installation -> inbabel.config.json
add{
and done. Otherwise some people will be stuck right after trying to run the first and simplest test."presets": [["@babel/preset-env"], ["@babel/preset-react"]]
}
Hi, thanks for your feedback! I cannot spot the typo you are talking about 🤔. I see
setupTests.js
everywhere.Babel configuration is out of the scope of the article because it's something about project configuration but it's probably useful to remind readers to install
@babel/core @babel/preset-env @babel/preset-react
and add ababel.config.json
like the one you suggested.Everyone interested in complete project configuration can see the repository I shared at the end of the article github.com/mbellagamba/testing-lib....
Yeah... it might have been my own typo, since I never copy/paste code. Thanks for clearing out the very basics for the
babel.config.json
file. Keep it up!