1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-jest
2016-12-20 13:03:44 -08:00
..
__tests__ fix jest example styles 2016-10-26 19:28:41 +09:00
pages Update index.js 2016-12-20 13:03:44 -08:00
package.json example: add missing dependencies and babel config 2016-10-29 22:20:29 +09:00
readme.md Update readme.md (#128) 2016-10-28 16:58:41 +09:00

Add testing to your next app using jest

jest is a testing framework for react. In this example we show how to use jest to do DOM-testing for react applications in next

npm install --save-dev jest babel-jest enzyme

  • jest - The testing framework
  • babel-jest - Babel preprocessor for test files
  • enzyme - Mock render the elements

Add test script to the recommended package.json

package.json

...
"scripts": {
    "test": "jest",
    ...
}
...

npm run test