From 7b34e6015fa92ee711b9d82fb332335b39fe1f0f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 26 Jul 2023 10:23:44 -0500 Subject: [PATCH] docs: mention granular unit tests preference under Local Development --- docs/contributing/Local_Development.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/contributing/Local_Development.mdx b/docs/contributing/Local_Development.mdx index 0b23be5c4a99..c6a5d56f3757 100644 --- a/docs/contributing/Local_Development.mdx +++ b/docs/contributing/Local_Development.mdx @@ -66,6 +66,16 @@ Coverage reports are be generated locally whenever `yarn test` is run. The `codecov` bot should also comment on your PR with the percentage, as well as links to the line-by-line coverage of each file touched by your PR. +#### Granular Unit Tests + +Most tests in most packages are set up as small, self-contained unit tests. +We generally prefer that to keep tests and their failure reports granular. + +For rule tests we recommend, when reasonable: + +- Including both `valid` and `invalid` code changes in most PRs that affect rule behavior +- Limiting to one error per `invalid` case + ### Type Checking All code should pass TypeScript type checking.