2017-02-06 14:19:34 +01:00
# Contributing to Next.js
Our Commitment to Open Source can be found [here ](https://zeit.co/blog/oss )
1. [Fork ](https://help.github.com/articles/fork-a-repo/ ) this repository to your own GitHub account and then [clone ](https://help.github.com/articles/cloning-a-repository/ ) it to your local device.
2019-02-14 14:33:00 +01:00
1. Install yarn: `npm install -g yarn`
1. Install the dependencies: `yarn`
1. Run `yarn run dev` to build and watch for code changes
2018-10-06 07:32:50 +02:00
2018-10-25 22:51:20 +02:00
## To run tests
2018-10-06 07:32:50 +02:00
Running all tests:
```
yarn testonly
```
Running a specific test suite inside of the `test/integration` directory:
```
yarn testonly --testPathPattern "production"
```
Running just one test in the `production` test suite:
```
yarn testonly --testPathPattern "production" -t "should allow etag header support"
```
2018-10-25 22:51:20 +02:00
## Running the integration test apps without running tests
2018-10-06 07:32:50 +02:00
```
./node_modules/.bin/next ./test/integration/basic
```
2018-10-25 22:51:20 +02:00
## Testing in your own app
2018-10-06 07:32:50 +02:00
2019-03-22 16:27:29 +01:00
Because of the way Node.js resolves modules the easiest way to test your own application is copying it into the `test` directory.
2018-10-06 07:32:50 +02:00
```
2019-03-22 16:27:29 +01:00
cp -r yourapp < next.js directory > /test/integration/yourapp
2018-10-06 07:32:50 +02:00
```
2019-03-22 16:27:29 +01:00
Make sure you remove `react` `react-dom` and `next` from `test/integration/yourapp/node_modules` as otherwise they will be overwritten.
2018-10-25 22:51:20 +02:00
2019-03-22 16:27:29 +01:00
```bash
rm -rf < next.js directory > /test/integration/yourapp/{react,react-dom,next,next-server}
2018-10-06 07:32:50 +02:00
```
2019-03-22 16:27:29 +01:00
Then run your app using:
2018-10-06 07:32:50 +02:00
```
2019-03-22 16:27:29 +01:00
./node_modules/.bin/next ./test/integration/yourapp
2018-10-06 07:32:50 +02:00
```