1
I am implementing tests in my web application in React with jest. As it was started with the "create-React-app" it was easy to set up the environment. But for some reason jest seems to ignore package.json specifications...
{
"jest": {
"collectCoverageFrom":[
"src/**/*.{js,sx}",
"!src/index.js",
"!src/BooksAPI.js"
],
"snapshotSerializers": ["enzyme-to-json/serializer"]
}
...
}
Although I added to the collectCoverageFrom to ignore the index and booksapi files they persist when I run tests with the --Coverage flag active. Also, although I specifically state that I want to use the serializer of the 'Enzyme-to-json' package, the snapshot remains the default for jest.
Does anyone know what I could possibly be doing wrong? I’ve checked the typing carefully and I think it’s correct. Follow the project link if necessary: https://github.com/Matheusbafutto/reactnd-project-myreads-starter
You may also have
collectCoverage: true
. You already tested that configuration?– Sergio
I tried it but it didn’t solve it...
– Matheus Bafutto