2018-04-13 16:53:59 +02:00
# Example app with Jest tests inside a NextJS TypeScript app
## How to use
### Using `create-next-app`
2019-10-11 05:34:14 +02:00
Execute [`create-next-app` ](https://github.com/zeit/next.js/tree/canary/packages/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:
2018-04-13 16:53:59 +02:00
```bash
npx create-next-app --example with-jest-typescript with-jest-typescript-app
# or
yarn create next-app --example with-jest-typescript with-jest-typescript-app
```
### Download manually
2018-07-11 23:56:15 +02:00
Download the example:
2018-04-13 16:53:59 +02:00
```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-jest-typescript
cd with-jest-typescript
```
Install it and run:
```bash
npm install
npm run dev
# or
yarn
yarn dev
```
## Run Jest tests
```bash
npm run test
# or
yarn test
```
## The idea behind the example
2019-05-29 13:57:26 +02:00
This example shows a configuration and several examples for a running Jest tests in a NextJS TypeScript app