From 15c54fb809343b3e599d59bd49331c86b6777055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=BCbotter?= Date: Mon, 4 Jan 2021 10:07:49 +0100 Subject: [PATCH] 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 --- CONTRIBUTING.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 459b0793f8c..95437f807ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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