You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-mocha)
2
+
3
+
# Example app with Mocha tests
4
+
5
+
## How to use
6
+
7
+
### Using `create-next-app`
8
+
9
+
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:
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mocha
23
+
cd with-mocha
24
+
```
25
+
26
+
Install it and run:
27
+
28
+
```bash
29
+
npm install
30
+
npm run dev
31
+
# or
32
+
yarn
33
+
yarn dev
34
+
```
35
+
36
+
## Run Mocha tests
37
+
38
+
```bash
39
+
npm run test
40
+
# or
41
+
yarn test
42
+
```
43
+
44
+
## The idea behind the example
45
+
46
+
This example features:
47
+
48
+
* An app with Mocha tests
49
+
50
+
> 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).
0 commit comments