Artikel Galerie Kontakt

unit-testing

Jest code coverage gives no output

Coverage won’t work with Jest in watch mode. Because “react-scripts test –env=jsdom” works in watch mode by default, the watch mode has to be switched off while generating the coverage output.

Setup Jest and Enzyme

Setting up a test environment in a react app, which was booted by create-react-app.