From c2ce832f651ab62ffbf2d07da18fd1818551a098 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Wed, 17 Oct 2018 13:46:05 +0200 Subject: [PATCH] fix(ivy): stub TestBed.compileComponents implementation (#26506) PR Close #26506 --- packages/core/test/test_bed_async_spec.ts | 18 ++++++++++++++++++ packages/core/testing/src/r3_test_bed.ts | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 packages/core/test/test_bed_async_spec.ts diff --git a/packages/core/test/test_bed_async_spec.ts b/packages/core/test/test_bed_async_spec.ts new file mode 100644 index 0000000000..56c3ed092b --- /dev/null +++ b/packages/core/test/test_bed_async_spec.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import {TestBed} from '@angular/core/testing/src/test_bed'; +import {AsyncTestCompleter, ddescribe, describe, inject, it} from '@angular/core/testing/src/testing_internal'; + +describe('TestBed with async processing', () => { + + beforeEach(() => { TestBed.resetTestingModule(); }); + + it('should allow injecting AsyncTestCompleter', + inject([AsyncTestCompleter], (async: AsyncTestCompleter) => { async.done(); })); +}); diff --git a/packages/core/testing/src/r3_test_bed.ts b/packages/core/testing/src/r3_test_bed.ts index 9dbabca5f1..6f88906ad2 100644 --- a/packages/core/testing/src/r3_test_bed.ts +++ b/packages/core/testing/src/r3_test_bed.ts @@ -270,9 +270,10 @@ export class TestBedRender3 implements Injector, TestBed { } } - // TODO(vicb): implement compileComponents(): Promise { - throw new Error('Render3TestBed.compileComponents is not implemented yet'); + // assume for now that components don't use templateUrl / stylesUrl to unblock further testing + // TODO(pk): plug into the ivy's resource fetching pipeline + return Promise.resolve(); } get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {