Add information on gulp diff to the contributing guidelines (#42031)

* Add information on gulp diff to the contributing guidelines

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
Jonas Hübotter 2021-01-04 10:07:49 +01:00 committed by GitHub
parent a412512fa0
commit 15c54fb809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,16 +189,25 @@ import { f as g } from "file1";
var x = g();
```
## Managing the Baselines
## Managing the baselines
Compiler tests generate baselines: one file each for the emitted `.js`, the errors produced by the compiler, the type of each expression, and symbol for each identifier. Additionally, some tests generate baselines for the source map output.
Most tests generate "baselines" to find differences in output.
As an example, compiler tests usually emit one file each for
- the `.js` and `.d.ts` output (all in the same `.js` output file),
- the errors produced by the compiler (in an `.errors.txt` file),
- the types of each expression (in a `.types` file),
- the symbols for each identifier (in a `.symbols` file), and
- the source map outputs for files if a test opts into them (in a `.js.map` file).
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
```Shell
gulp diff
git diff --diff-filter=AM --no-index ./tests/baselines/reference ./tests/baselines/local
```
Alternatively, you can set the `DIFF` environment variable and run `gulp diff`, or manually run your favorite folder diffing tool between `tests/baselines/reference` and `tests/baselines/local`. Our team largely uses Beyond Compare and WinMerge.
After verifying that the changes in the baselines are correct, run
```Shell