From 228e73532d9876f8598e720434dc5fda2c44bad7 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Mon, 14 Oct 2019 09:55:04 -0700 Subject: [PATCH] =?UTF-8?q?[docs]=20Updated=20How=20to=20Work=20on=20Chall?= =?UTF-8?q?enge=20Files=20to=20explain=20how=20t=E2=80=A6=20(#37188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: added how to test individual challenges * fix: shortened sentence Co-Authored-By: Oliver Eyton-Williams * fix: made sentence more concise Co-Authored-By: Oliver Eyton-Williams * fix: added file extension Co-Authored-By: Oliver Eyton-Williams * fix: added testStrings in the requirements Co-Authored-By: Oliver Eyton-Williams * fix: improved the instructions wording Co-Authored-By: Oliver Eyton-Williams --- docs/how-to-work-on-coding-challenges.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/how-to-work-on-coding-challenges.md b/docs/how-to-work-on-coding-challenges.md index be7cc78b12..fb07b80a31 100644 --- a/docs/how-to-work-on-coding-challenges.md +++ b/docs/how-to-work-on-coding-challenges.md @@ -304,6 +304,26 @@ function myFunc() { ```` +## Testing Challenges + +Before you [create a pull request](how-to-open-a-pull-request.md) for your changes, you need to validate that the changes you have made do not inadvertently cause problems with the challenge. To test all challenges run `npm run test:curriculum`. To save time you can limit the tests to one challenge by performing the following steps: + +1. In the `.env` file, set the environment variable `TEST_CHALLENGES_FOR_LANGS` to the language of the challenge(s) you need to test. The currently accepted values are `english`, `arabic`, `chinese`, `portuguese`, `russian` and `spanish`. + +2. Switch to the `curriculum` directory: + +``` + cd curriculum +``` + +3. Run the following for each challenge file for which you have changed any `testString`s or added solutions: + +``` +npm run test -- -g 'the full English title of the challenge' +``` + +Once you have verified that each challenge you've worked on passes the tests, please create a pull request. + ### Useful Links Creating and Editing Challenges: