diff --git a/.github/contributing.md b/.github/contributing.md index 59d1107c4b19ca..26e992905c128f 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -31,8 +31,41 @@ Before you start any Pull Request, it's recommended that you open a [discussion] That way you can be sure that the maintainer(s) agree on what to change and how, and you can hopefully get a quick merge afterwards. Also, let the maintainers know that you plan to work on a particular issue so that no one else starts any duplicate work. +### Tests + Pull Requests can only be merged once all status checks are green, which means `pnpm test` passes, and coverage is 100%. +Use these commands to help run your tests: + +- To run a single test folder, specify the path + + ```bash + pnpm jest platform/gitlab + ``` + +- To run against a single test file, specify down to the filename (suffix is not necessary) + + ```bash + pnpm jest platform/gitlab/index + ``` + +- To run a single test batch, the `-t` value must be part of the `describe` value of the test batch + + ```bash + pnpm jest platform/gitlab/index -t "getJsonFile" + ``` + +- To run a single test, the `-t` value must be part of the `it` value of the test batch + + ```bash + pnpm jest platform/gitlab/index -t "returns file content from given repo" + ``` + +And some options: + +- `--verbose=false` to avoid the test list +- `--collectCoverage=false` to avoid collecting coverage, faster for the part you need the test to pass + ## Do not force push to your pull request branch Please do not force push to your PR's branch after you have created your PR, as doing so forces us to review the whole PR again.