From 5247594e86871dbfc8eaa6dffe607a43f3f06ce7 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 12 Nov 2018 22:18:28 +0100 Subject: [PATCH] fix(ivy): add support for providers in TestBed.configureCompiler (#27066) Adds support for the `providers` that are passed in through `TestBed.configureCompiler` and scopes the error only if the consumer has passed in `useJit`. PR Close #27066 --- packages/core/testing/src/r3_test_bed.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/testing/src/r3_test_bed.ts b/packages/core/testing/src/r3_test_bed.ts index 567a0abb3e..a69b26409b 100644 --- a/packages/core/testing/src/r3_test_bed.ts +++ b/packages/core/testing/src/r3_test_bed.ts @@ -251,7 +251,13 @@ export class TestBedRender3 implements Injector, TestBed { } configureCompiler(config: {providers?: any[]; useJit?: boolean;}): void { - throw new Error('the Render3 compiler is not configurable !'); + if (config.useJit != null) { + throw new Error('the Render3 compiler JiT mode is not configurable !'); + } + + if (config.providers) { + this._providerOverrides.push(...config.providers); + } } configureTestingModule(moduleDef: TestModuleMetadata): void {