From 074137229dc75d9ca7f298551b8f9d418f01223c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 7 Dec 2017 12:07:52 +0000 Subject: [PATCH] Document support for debugging tests --- content/docs/how-to-contribute.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/docs/how-to-contribute.md b/content/docs/how-to-contribute.md index 78b68b5e..28daa0e5 100644 --- a/content/docs/how-to-contribute.md +++ b/content/docs/how-to-contribute.md @@ -83,10 +83,11 @@ The core team is monitoring for pull requests. We will review your pull request 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`. -6. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). -7. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. -8. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`). -9. If you haven't already, complete the CLA. +6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect". +7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). +8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. +9. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`). +10. If you haven't already, complete the CLA. ### Contributor License Agreement (CLA) @@ -111,6 +112,7 @@ Then, you can run several commands: * `yarn test --watch` runs an interactive test watcher. * `yarn test ` runs tests with matching filenames. * `yarn test-prod` runs tests in the production environment. It supports all the same options as `yarn test`. +* `yarn debug-test` is just like `yarn test` but with a debugger. Open `chrome://inspect` and press "Inspect". * `yarn flow` runs the [Flow](https://flowtype.org/) typechecks. * `yarn build` creates a `build` folder with all the packages. * `yarn build core,dom --type=UMD` creates UMD builds of just React and ReactDOM.