Skip to content

Commit 08b7a24

Browse files
authored
Update local testing doc to show our own workflow (vercel#6753)
As per https://twitter.com/pierrevanmart/status/1109030783405248513
1 parent efdbd87 commit 08b7a24

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

contributing.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,20 @@ yarn testonly --testPathPattern "production" -t "should allow etag header suppor
3535

3636
## Testing in your own app
3737

38-
First `next-server` needs to be linked:
38+
Because of the way Node.js resolves modules the easiest way to test your own application is copying it into the `test` directory.
3939

4040
```
41-
cd packages/next-server
42-
npm link
41+
cp -r yourapp <next.js directory>/test/integration/yourapp
4342
```
4443

45-
Then `next` needs to link to `next-server`, and be linked itself:
44+
Make sure you remove `react` `react-dom` and `next` from `test/integration/yourapp/node_modules` as otherwise they will be overwritten.
4645

47-
```
48-
cd packages/next
49-
npm link
50-
npm link next-server
46+
```bash
47+
rm -rf <next.js directory>/test/integration/yourapp/{react,react-dom,next,next-server}
5148
```
5249

53-
And finally, link the `next` package inside your app:
50+
Then run your app using:
5451

5552
```
56-
npm link next
53+
./node_modules/.bin/next ./test/integration/yourapp
5754
```
58-
59-
Then you can run your app with the local version of Next.js (You may need to re-run the example app as you change server side code in the Next.js repository).

0 commit comments

Comments
 (0)