0f23f7343e
When `TestBed.compileComponents` is called under ViewEngine, we kick off a compilation and return a promise that resolves once the compilation is done. In most cases the consumer doesn't _have_ to await the returned promise, unless their components have external resources. The problem is that the test could be over by the time the promise has resolved, in which case we still cache the factory of the test module. This becomes a problem if another compilation is triggered right afterwards, because it'll see that we still have a `_moduleFactory` and it won't recreate the factory. These changes resolve the issue by saving a reference to the module type that is being compiled and checking against it when the promise resolves. Note that while this problem was discovered while trying to roll out the new test module teardown behavior in the Components repo (https://github.com/angular/components/pull/23070), it has been there for a long time. The new test behavior made it more apparent. PR Close #42669 |
||
---|---|---|
.. | ||
src | ||
BUILD.bazel | ||
PACKAGE.md | ||
index.ts | ||
package.json | ||
public_api.ts |