mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(platform-browser): complete component bootstrap before switching to the next test (#43933)
The bootstrap tests that reused the same component (the `HelloRootCmp` one) were randomly failing due to the incomplete cleanup between tests. This commit ensures that the component bootstrap is fully cimpleted and there are no pending async actions before going to the next test. PR Close #43933
This commit is contained in:
committed by
Jessica Janiuk
parent
6e37c938e2
commit
bf1a2fc2d5
@@ -272,9 +272,10 @@ function bootstrap(
|
||||
});
|
||||
}
|
||||
|
||||
it('should create an injector promise', () => {
|
||||
it('should create an injector promise', async () => {
|
||||
const refPromise = bootstrap(HelloRootCmp, testProviders);
|
||||
expect(refPromise).toEqual(jasmine.any(Promise));
|
||||
await refPromise; // complete component initialization before switching to the next test
|
||||
});
|
||||
|
||||
it('should set platform name to browser', done => {
|
||||
|
||||
Reference in New Issue
Block a user