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
Arunoda Susiripala f1c6ea3248 Fix Jest example app (#458)
* Add a working JEST example app.

* Add README.md

* Move react-test-renderer to devDeps.

* Add a newline to the .babelrc
2016-12-21 23:06:24 +09:00
..
__tests__ Fix Jest example app (#458) 2016-12-21 23:06:24 +09:00
pages Fix Jest example app (#458) 2016-12-21 23:06:24 +09:00
.babelrc Fix Jest example app (#458) 2016-12-21 23:06:24 +09:00
package.json Fix Jest example app (#458) 2016-12-21 23:06:24 +09:00
README.md Fix Jest example app (#458) 2016-12-21 23:06:24 +09:00

Example app using Jest to run tests

This example features:

  • A properly configured Next.js app for Jest
  • An example test written with Jest Snapshot Testing
  • An example test written with Enzyme

How to run it

npm install
npm run dev

After you've added jest-cli and jest-babel into your app, make sure to add the following .babelrc file.

{
    "presets": ["next/babel"]
}

It'll ask Jest to use the babel configurations used by Next.js.