From bf1a2fc2d5ea394a35577bcd1bb68b807e6e2c14 Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Sat, 23 Oct 2021 12:46:07 -0700 Subject: [PATCH] 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 --- packages/platform-browser/test/browser/bootstrap_spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/platform-browser/test/browser/bootstrap_spec.ts b/packages/platform-browser/test/browser/bootstrap_spec.ts index e8ae8b2b0bb..a8e2d1a0b64 100644 --- a/packages/platform-browser/test/browser/bootstrap_spec.ts +++ b/packages/platform-browser/test/browser/bootstrap_spec.ts @@ -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 => {