README.md 795 字节
Newer Older
1
[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-jest)
2 3 4 5
# Example app with jest tests

## How to use

S
Sébastien Dubois 已提交
6
Download the example [or clone the repo](https://github.com/zeit/next.js):
7 8 9 10 11 12

```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/master | tar -xz --strip=2 next.js-master/examples/with-jest
cd with-jest
```

D
Dan Zajdband 已提交
13
Install it and test:
14 15 16 17 18 19 20 21 22 23 24

```bash
npm install
npm test
```

## The idea behind the example

This example features:

* An app with jest tests
25 26

> A very important part of this example is the `.babelrc` file which configures the `test` environment to use `babel-preset-env` and configures it to transpile modules to `commonjs`). [Learn more](https://github.com/zeit/next.js/issues/2895).