Skip to content

Commit 52cc5d2

Browse files
committed
Update documentation with the new commands.
1 parent 296ac51 commit 52cc5d2

File tree

4 files changed

+42
-28
lines changed

4 files changed

+42
-28
lines changed

CONTRIBUTING.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,25 @@ lerna run lint
5858
lerna exec -- david u
5959
```
6060

61-
You can also work on a single package by `cd`-ing into that module, and using
62-
normal `npm` scripts
61+
You can no longer work on a single package by `cd`-ing into that module, and using
62+
normal `npm` scripts. This is because of the way lerna hoists commands up to the
63+
root level. When working on a single package, instead run the lerna command with
64+
a scope of that package name.
6365

66+
For example, from the root of the repo:
6467
```
65-
cd packages/generator-react-server
66-
npm i
67-
npm test
68+
lerna run build --scope 'react-server'
69+
lerna run build --scope 'react-server-cli'
70+
lerna run test --scope 'react-server-cli'
6871
```
6972

70-
but you should still run a full monorepo build and test before submitting a pr.
73+
You should always run a full monorepo lint, build, and test before submitting a pr.
74+
```
75+
npm run lint
76+
npm run clean
77+
npm run build
78+
npm run test
79+
```
7180

7281
## Testing
7382

MAINTAINING.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
- Make sure it's `https://registry.npmjs.org/`
1414
- `npm run clean`
1515
- `npm run nuke && npm run bootstrap`
16+
- `npm run lint`
17+
- `npm run build`
1618
- `npm test`
1719
- `export GITHUB_AUTH="..."`
1820
- `npm run changelog >> CHANGELOG.md`

packages/react-server-integration-tests/README.md

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
# Testing `react-server`
22

3-
This directory contains integration tests that test the core features of `react-server` and `react-server-cli` as a server and client framework. Tests code can be found in the `react-server/integration-tests/src/__tests__` subdirectory.
3+
This directory contains integration tests that test the core features of `react-server` and `react-server-cli` as a server and client framework. Tests code can be found in the `react-server/packages/react-server-integration-tests/src/__tests__` subdirectory.
44

55
## To run all the tests
66

7-
1. cd to the `react-server/integration-tests` directory.
8-
1. If you haven't ever run tests before: `npm install -g gulp`.
9-
1. `npm install`
10-
1. `gulp test`
7+
1. Start at the root of the monorepo and follow the monorepo installation procedures.
8+
1. `npm run build`
9+
1. `lerna run test --stream --scope 'react-server-integration-tests'`
1110

1211
You should see something like:
1312

1413
```
15-
$ gulp test
16-
[09:31:12] Using gulpfile ~/code/main/react-server/packages/react-server/gulpfile.js
17-
[09:31:12] Starting 'compileServer'...
18-
[09:31:12] Starting 'compileClient'...
19-
[09:31:14] Finished 'compileServer' after 2.16 s
20-
[09:31:14] Finished 'compileClient' after 2.15 s
21-
[09:31:14] Starting 'test'...
22-
..................................................
23-
24-
50 specs, 0 failures
25-
Finished in 0 seconds
26-
[09:31:27] Finished 'test' after 13 s
14+
lerna info filter [ 'react-server-integration-tests' ]
15+
lerna info Executing command in 1 package: "npm run test"
16+
react-server-integration-tests: > [email protected] test /Users/drewpc/Documents/SoprisApps/git-repos/react-server/packages/react-server-integration-tests
17+
react-server-integration-tests: > PORT=8771 gulp test
18+
react-server-integration-tests: [16:36:22] Failed to load external module @babel/register
19+
react-server-integration-tests: [16:36:22] Requiring external module babel-register
20+
react-server-integration-tests: [16:36:23] Using gulpfile ~/Documents/SoprisApps/git-repos/react-server/packages/react-server-integration-tests/gulpfile.babel.js
21+
react-server-integration-tests: [16:36:24] Starting 'compile'...
22+
react-server-integration-tests: [16:36:24] Finished 'compile' after 875 ms
23+
react-server-integration-tests: [16:36:24] Starting 'test'...
24+
react-server-integration-tests: ...........................................................................................................................................
25+
react-server-integration-tests: 139 specs, 0 failures
26+
react-server-integration-tests: Finished in 72.7 seconds
27+
react-server-integration-tests: [16:38:04] Finished 'test' after 1.22 min
28+
lerna success run Ran npm script 'test' in 1 package in 77.9s:
29+
lerna success - react-server-integration-tests
2730
```
2831

2932
Each little green dot is a test spec that passed. Every red "F" is a test that failed, but you probably know that if you have written Jasmine tests before. There may be a few errors logged to the console as part of tests that expect an error. As long as it says "0 failures", the tests passed.
@@ -39,7 +42,7 @@ We're using [Jasmine 2.3.x](http://jasmine.github.io/2.3/introduction.html) as o
3942

4043
Let's say that we wanted to just test that `react-server` will render a simple "Hello, world!" page.
4144

42-
First, make a subdirectory of `react-server/integration-tests/src/__tests__`, called "helloWorld". Please don't put Spec files and Page files directly in the `__tests__` directory. I expect that most of the `__tests__` sub-directories will have one Spec file and one or more Page files, but it's certainly reasonable to put multiple related Spec files in a directory together.
45+
First, make a subdirectory of `react-server/packages/react-server-integration-tests/src/__tests__`, called "helloWorld". Please don't put Spec files and Page files directly in the `__tests__` directory. I expect that most of the `__tests__` sub-directories will have one Spec file and one or more Page files, but it's certainly reasonable to put multiple related Spec files in a directory together.
4346

4447
Next, we'd write a `Page` class that exercises the functionality we want to test in `react-server`:
4548

packages/react-server-test-pages/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Setup (from the repo root):
88

99
```bash
1010
$ npm run bootstrap
11-
$ cd packages/react-server-test-pages
12-
$ npm start
11+
$ lerna run start --stream --scope 'react-server-test-pages'
1312
```
1413

1514
Then hit http://localhost:3000/ to see what's available.
@@ -18,9 +17,10 @@ If you make changes in `packages/react-server` you'll need to `CTRL-C` and
1817
re-build `react-server` to pick them up.
1918

2019
```bash
21-
$ cd ../react-server && npm run prepublish && cd - && npm start
20+
$ lerna run build --stream --scope 'react-server'
21+
$ lerna run start --stream --scope 'react-server-test-pages'
2222
```
2323

24-
If you wish to run the test server in debug mode, simply replace `npm start` with `npm run debug`.
24+
If you wish to run the test server in debug mode, simply replace `start` with `debug`.
2525

2626
Add pages in `entrypoints.js`. Instructions are at the top.

0 commit comments

Comments
 (0)