From 4125b5d7ab21e72d2955c0d19a5d171e1d284fb1 Mon Sep 17 00:00:00 2001 From: SmolParascythe <106285195+SmolParascythe@users.noreply.github.com> Date: Mon, 18 Jul 2022 20:01:26 -0700 Subject: [PATCH 1/5] Fix grammar and made writing succinct in README --- tests/README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/README.md b/tests/README.md index 4377e7a779..c140448954 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,26 +1,26 @@ ## Tests -It's not strictly necessary to run tests locally while developing: You can +It's not strictly necessary to run tests locally while developing. You can always open a pull request and rely on the CI service to run tests for you, -but sometimes it's helpful to run tests locally before pushing your changes to +but it's helpful to run tests locally before pushing your changes to GitHub. -Test are written using [jest](https://ghub.io/jest), a framework maintained -by Facebook and used by many teams at GitHub. Jest is convenient in that it -provides everything: a test runner, an assertion library, code coverage analysis, +Tests are written using [jest](https://ghub.io/jest), a framework maintained +by Facebook and used by many teams at GitHub. +Jest provides everything: a test runner, an assertion library, code coverage analysis, custom reporters for different types of test output, etc. ### Install optional dependencies -We typically rely on CI to run our tests, so we consider some large test-only -dependencies **optional** (for example, puppeteer). In order to run the tests locally you'll +We typically rely on CI to run our tests, so some large test-only +dependencies are considered **optional** (for example, puppeteer). To run the tests locally, you'll need to make sure optional dependencies are installed by running: ```sh npm ci --include=optional ``` -If you run into the error "Could not find expected browser (chrome) locally" you may need to manually install the expected chromium version with: +If you run into the error "Could not find expected browser (chrome) locally", you may need to install the expected chromium version manually with: ``` node node_modules/puppeteer/install.js ``` @@ -36,10 +36,10 @@ script/test # or `npm test` ### Watching all the tests -You can also run a script that will continually watch for changes and -re-run the tests any time a change is made. This command will notify you -when tests change to and from a passing or failing state, and will also print -out a test coverage report, so you can see what files are in need of tests. +You can run a script that continually watches for changes and +re-runs the tests whenever a change is made. This command notifies you +when tests change to and from a passing or failing state, and it prints +out a test coverage report so you can see what files need testing. ```sh npm run test-watch @@ -47,7 +47,7 @@ npm run test-watch ### Running individual tests -You can run specific tests in one of these two ways: +You can run specific tests in two ways: ```sh # The TEST_NAME can be a filename, partial filename, or path to a file or directory @@ -79,11 +79,11 @@ npm run lint ### Keeping the server running -When you run `jest` tests, that depend on making real HTTP requests +When you run `jest` tests that depend on making real HTTP requests to `localhost:4000`, the `jest` tests have a hook that starts the -server before running all/any tests, and stops the server when it's done. +server before running all/any tests and stops the server when done. -You can disable that, which might make it easier when debugging tests +You can disable this, which might make it easier when debugging tests since the server won't need to start and stop every time you run tests. In one terminal type: @@ -92,12 +92,12 @@ In one terminal type: NODE_ENV=test PORT=4000 node server.mjs ``` -and then, in another terminal type: +In another terminal type: ```sh START_JEST_SERVER=false jest tests/rendering/foo/bar.js ``` -Or whatever the testing command you use. Note the `START_JEST_SERVER=false` -environment variable that needs to be set or else, `jest` will try to start +Or whatever the testing command you use is. +**Note:** the `START_JEST_SERVER=false` environment variable needs to be set, or else `jest` will try to start a server on `:4000` too. From c109de25236711e8d986d180519f4d402df40647 Mon Sep 17 00:00:00 2001 From: SmolParascythe <106285195+SmolParascythe@users.noreply.github.com> Date: Mon, 18 Jul 2022 20:07:56 -0700 Subject: [PATCH 2/5] Fix grammar and made writing succinct in README --- tests/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/README.md b/tests/README.md index c140448954..d3c589b30c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -86,18 +86,19 @@ server before running all/any tests and stops the server when done. You can disable this, which might make it easier when debugging tests since the server won't need to start and stop every time you run tests. -In one terminal type: +In one terminal, type: ```sh NODE_ENV=test PORT=4000 node server.mjs ``` -In another terminal type: +In another terminal, type: ```sh START_JEST_SERVER=false jest tests/rendering/foo/bar.js ``` Or whatever the testing command you use is. + **Note:** the `START_JEST_SERVER=false` environment variable needs to be set, or else `jest` will try to start a server on `:4000` too. From 0e216da252eacf96deeb2c546d635684bbff0a54 Mon Sep 17 00:00:00 2001 From: SmolParascythe <106285195+SmolParascythe@users.noreply.github.com> Date: Mon, 18 Jul 2022 20:08:57 -0700 Subject: [PATCH 3/5] Fix grammar and made writing succinct in README --- tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index d3c589b30c..3cbf0fc2a7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -100,5 +100,5 @@ START_JEST_SERVER=false jest tests/rendering/foo/bar.js Or whatever the testing command you use is. -**Note:** the `START_JEST_SERVER=false` environment variable needs to be set, or else `jest` will try to start +**Note:** The `START_JEST_SERVER=false` environment variable needs to be set, or else `jest` will try to start a server on `:4000` too. From 57e68c9f116686a831f205208541b299d819026f Mon Sep 17 00:00:00 2001 From: SmolParascythe <106285195+SmolParascythe@users.noreply.github.com> Date: Mon, 18 Jul 2022 20:18:57 -0700 Subject: [PATCH 4/5] Add Note callout and reword sentence --- tests/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 3cbf0fc2a7..f60ef8847c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -100,5 +100,9 @@ START_JEST_SERVER=false jest tests/rendering/foo/bar.js Or whatever the testing command you use is. -**Note:** The `START_JEST_SERVER=false` environment variable needs to be set, or else `jest` will try to start +{% note %} + +**Note:** The `START_JEST_SERVER` environment variable needs to be set to `false`, or else `jest` will try to start a server on `:4000` too. + +{% endnote %} From dc67e1cc38ed4c341a93bac55789b1c189cf62ec Mon Sep 17 00:00:00 2001 From: Sophie <29382425+sophietheking@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:23:38 +0200 Subject: [PATCH 5/5] Update README.md --- tests/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/README.md b/tests/README.md index f60ef8847c..d5e8976c20 100644 --- a/tests/README.md +++ b/tests/README.md @@ -100,9 +100,5 @@ START_JEST_SERVER=false jest tests/rendering/foo/bar.js Or whatever the testing command you use is. -{% note %} - -**Note:** The `START_JEST_SERVER` environment variable needs to be set to `false`, or else `jest` will try to start +The `START_JEST_SERVER` environment variable needs to be set to `false`, or else `jest` will try to start a server on `:4000` too. - -{% endnote %}