Skip to content

Commit

Permalink
test(platform-browser): complete component bootstrap before switching…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
AndrewKushnir authored and thePunderWoman committed Oct 25, 2021
1 parent 067ae54 commit c831c67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/platform-browser/test/browser/bootstrap_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit c831c67

Please sign in to comment.