angular/packages/core/test
JoostK 627e807eb8 fix(compiler): properly compile DI factories when coverage reporting is enabled (#44732)
When running tests with code coverage using Istanbul, the code is
instrumented with coverage reporting statements. These statements are
also inserted into synthesized constructors, preventing Angular from
properly recognizing them as synthesized constructor.

This commit changes the regex to detect synthesized constructors to allow
for statements within the constructor before the `super(...arguments);`
call. This is limited to code that does not contain a `}`, but this
is sufficient to support Istanbul's coverage instrumentation statements.

The tests have been extended with an input file that is being
instrumented using `babel-plugin-istanbul` for both ES2015 and ES5
targets, in order to verify that the approach works for real-world
usages.

Fixes #31337

PR Close #44732
2022-01-21 13:10:42 -08:00
..
acceptance fix(core): consistently use namespace short name rather than URI (#44766) 2022-01-21 11:19:30 -08:00
animation fix(animations): apply setStyles to only rootTimelines (#44515) 2022-01-13 12:01:50 -08:00
bundling feat(core): allow for injector to be specified when creating an embedded view (#44666) 2022-01-19 09:09:38 -08:00
change_detection test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
compiler build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
debug build: bundle spec files for saucelabs legacy job (#44281) 2021-11-30 11:56:04 -05:00
di refactor(core): make the error messages tree shakable (#44359) 2022-01-18 17:38:10 -08:00
dom test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
i18n build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
linker refactor(core): make the error messages tree shakable (#44359) 2022-01-18 17:38:10 -08:00
metadata build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
reflection fix(compiler): properly compile DI factories when coverage reporting is enabled (#44732) 2022-01-21 13:10:42 -08:00
render3 build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
sanitization refactor(core): make the error messages tree shakable (#44359) 2022-01-18 17:38:10 -08:00
strict_types refactor(core): rename ...WithMeta types to ...Declaration and alias to unknown (#41119) 2021-03-22 08:57:18 -07:00
testability refactor(core): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:15 -07:00
util refactor(compiler): cleanup AST fixup of listener instructions (#44411) 2022-01-04 15:54:09 -08:00
zone test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
application_init_spec.ts test(core): refactor ApplicationInitStatus tests to avoid TestBed side-effects (#33222) 2021-02-22 08:41:49 -08:00
application_module_spec.ts test: remove Ivy/ViewEngine switch helpers and obsolete tests (#44120) 2021-11-24 19:42:39 +00:00
application_ref_integration_spec.ts refactor: delete the View Engine runtime (#43884) 2021-11-23 21:10:06 +00:00
application_ref_spec.ts refactor(core): make the error messages tree shakable (#44359) 2022-01-18 17:38:10 -08:00
BUILD.bazel build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
component_fixture_spec.ts feat(core): update reference and doc to change async to waitAsync. (#37583) 2020-08-03 12:54:13 -07:00
dev_mode_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_integration_spec.ts build: bundle spec files for saucelabs legacy job (#44281) 2021-11-30 11:56:04 -05:00
error_handler_spec.ts refactor(core): move runtime error code logic (#44398) 2022-01-06 23:43:18 +00:00
event_emitter_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
fake_async_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
forward_ref_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
runtime_error_spec.ts refactor(core): move runtime error code logic (#44398) 2022-01-06 23:43:18 +00:00
test_bed_spec.ts test: spy on console.error in configureTestingModule reset test (#44377) 2021-12-07 08:34:29 -05:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00