angular-cn/packages/compiler-cli/test/compliance/test_helpers
Pete Bacon Darwin 9066ca9e92 test(compiler-cli): add support for source-map checks in compliance tests (#39939)
This commit allows compliance test-cases to be written that specify
source-map mappings between the source and generated code.

To check a mapping, add a `// SOURCE:` comment to the end of a line:

```
<generated code> // SOURCE: "<source-url>" <source code>
```

The generated code will still be checked, stripped of the `// SOURCE` comment,
as normal by the `expectEmit()` helper.

In addition, the source-map segments are checked to ensure that there is a
mapping from `<generated code>` to `<source code>` found in the file at
`<source-url>`.

Note:

* The source-url should be absolute, with the directory containing the
  TEST_CASES.json file assumed to be `/`.
* Whitespace is important and will be included when comparing the segments.
* There is a single space character between each part of the line.
* Newlines within a mapping must be escaped since the mapping and comment
  must all appear on a single line of this file.

PR Close #39939
2020-12-07 16:21:05 -08:00
..
BUILD.bazel test(compiler-cli): add support for source-map checks in compliance tests (#39939) 2020-12-07 16:21:05 -08:00
check_errors.ts test(compiler-cli): log unexpected compilation errors in compliance test runner (#39862) 2020-12-02 14:56:38 -08:00
check_expectations.ts test(compiler-cli): add support for source-map checks in compliance tests (#39939) 2020-12-07 16:21:05 -08:00
compile_test.ts test(compiler-cli): improve compliance test performance (#39956) 2020-12-04 10:17:21 -08:00
di_checks.ts test(compiler-cli): convert di compliance tests (#39863) 2020-11-30 11:21:23 -08:00
expect_emit.ts test(compiler-cli): migrate i18n compliance tests (#39661) 2020-11-25 11:08:39 -08:00
expected_file_macros.ts test(compiler-cli): convert components & directives compliance tests (#39920) 2020-12-03 13:41:20 -08:00
function_checks.ts test(compiler-cli): migrate template compliance tests (#39871) 2020-12-01 14:58:11 -08:00
get_compliance_tests.ts test(compiler-cli): improve compliance test compile mode filtering (#39939) 2020-12-07 16:21:04 -08:00
golden_partials.ts test(compiler-cli): ensure that golden partial files are parsed accurately (#39939) 2020-12-07 16:21:02 -08:00
i18n_checks.ts test(compiler-cli): migrate i18n compliance tests (#39661) 2020-11-25 11:08:39 -08:00
i18n_helpers.ts test(compiler-cli): migrate i18n compliance tests (#39661) 2020-11-25 11:08:39 -08:00
sourcemap_helpers.ts test(compiler-cli): add support for source-map checks in compliance tests (#39939) 2020-12-07 16:21:05 -08:00
test_runner.ts test(compiler-cli): improve compliance test compile mode filtering (#39939) 2020-12-07 16:21:04 -08:00