Download the example or clone the repo:
curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-jest
cd with-jestInstall it and test:
npm install
npm testThis example features:
- An app with jest tests
A very important part of this example is the
.babelrcfile which configures thetestenvironment to usebabel-preset-envand configures it to transpile modules tocommonjs). Learn more.