2018-04-03 14:19:05 +02:00
# Example app with Jest tests
2016-12-22 22:04:32 +01:00
## How to use
2017-12-03 05:30:17 +01:00
### Using `create-next-app`
2018-04-03 14:19:05 +02:00
Execute [`create-next-app` ](https://github.com/segmentio/create-next-app ) with [Yarn ](https://yarnpkg.com/lang/en/docs/cli/create/ ) or [npx ](https://github.com/zkat/npx#readme ) to bootstrap the example:
2017-12-03 05:30:17 +01:00
2018-03-14 09:09:46 +01:00
```bash
npx create-next-app --example with-jest with-jest-app
# or
yarn create next-app --example with-jest with-jest-app
2017-12-03 05:30:17 +01:00
```
### Download manually
2018-07-11 23:56:15 +02:00
Download the example:
2016-12-22 22:04:32 +01:00
```bash
2017-12-07 03:12:42 +01:00
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-jest
2016-12-22 22:04:32 +01:00
cd with-jest
```
2018-04-03 14:19:05 +02:00
Install it and run:
2016-12-22 22:04:32 +01:00
```bash
npm install
2018-04-03 14:19:05 +02:00
npm run dev
# or
yarn
yarn dev
```
## Run Jest tests
```bash
npm run test
# or
yarn test
2016-12-22 22:04:32 +01:00
```
## The idea behind the example
This example features:
2019-04-22 16:56:02 +02:00
- An app with jest tests