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
This commit is contained in:
Kristiyan Kostadinov 2018-11-12 22:18:28 +01:00 committed by Andrew Kushnir
parent 095b6e8113
commit 5247594e86
1 changed files with 7 additions and 1 deletions

View File

@ -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 {