angular/packages/core/testing/src
JoostK cd2d82a91a fix(core): associate the NgModule scope for an overridden component (#42817)
When using `TestBed.overrideComponent`, the overridden component would
incorrectly lose access to its NgModule's declaration scope if the
NgModule had been imported into the testing NgModule as a
`ModuleWithProviders`, e.g. using a `forRoot` call.

The issue occurred as the `TestBed` compiler did not consider NgModules
that had been imported as a `ModuleWithProviders` when associating
NgModules with component overrides. This caused the overridden component
to be compiled standalone, meaning that it does not have access to
its NgModule's declarations. This commit extends the logic for
traversing the NgModule graph to also consider `ModuleWithProviders`
imports.

Fixes #42734

PR Close #42817
2021-07-13 15:59:28 -07:00
..
async.ts feat(core): drop support for zone.js 0.10.x (#40823) 2021-02-24 07:58:29 -08:00
component_fixture.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
fake_async.ts docs: edit copy for tick() in testing and api docs (#35697) 2021-05-25 18:03:32 +00:00
lang_utils.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
logger.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_override.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_overrider.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ng_zone_mock.ts refactor(core): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:15 -07:00
private_export_testing.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_test_bed.ts feat(core): add opt-in test module teardown configuration (#42566) 2021-06-17 18:03:47 +00:00
r3_test_bed_compiler.ts fix(core): associate the NgModule scope for an overridden component (#42817) 2021-07-13 15:59:28 -07:00
resolvers.ts refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
styling.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bed.ts fix(core): error in TestBed if module is reset mid-compilation in ViewEngine (#42669) 2021-06-30 14:32:23 -07:00
test_bed_common.ts feat(core): add opt-in test module teardown configuration (#42566) 2021-06-17 18:03:47 +00:00
test_compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_hooks.ts feat(core): add opt-in test module teardown configuration (#42566) 2021-06-17 18:03:47 +00:00
testing.ts feat(core): add opt-in test module teardown configuration (#42566) 2021-06-17 18:03:47 +00:00
testing_internal.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00