mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00: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:
parent
6e37c938e2
commit
bf1a2fc2d5
1 changed files with 2 additions and 1 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue