test(ivy): ngcc - check the actual file that is passed to `renderImports` (#25445)

Previously we were just checking that the object was "any" object but now
we check that it is the file object that we expected.

PR Close #25445
This commit is contained in:
Pete Bacon Darwin 2019-04-28 20:48:33 +01:00 committed by Jason Aden
parent ac34a1429b
commit 8e201f713a
1 changed files with 13 additions and 5 deletions

View File

@ -80,8 +80,12 @@ function createTestRenderer(
spyOn(renderer, 'addDefinitions').and.callThrough(); spyOn(renderer, 'addDefinitions').and.callThrough();
spyOn(renderer, 'removeDecorators').and.callThrough(); spyOn(renderer, 'removeDecorators').and.callThrough();
return {renderer, decorationAnalyses, switchMarkerAnalyses, moduleWithProvidersAnalyses, return {renderer,
privateDeclarationsAnalyses}; decorationAnalyses,
switchMarkerAnalyses,
moduleWithProvidersAnalyses,
privateDeclarationsAnalyses,
bundle};
} }
@ -488,8 +492,12 @@ describe('Renderer', () => {
contents: 'export declare class LibraryModule {}' contents: 'export declare class LibraryModule {}'
}, },
]; ];
const {renderer, decorationAnalyses, switchMarkerAnalyses, privateDeclarationsAnalyses, const {renderer,
moduleWithProvidersAnalyses} = decorationAnalyses,
switchMarkerAnalyses,
privateDeclarationsAnalyses,
moduleWithProvidersAnalyses,
bundle} =
createTestRenderer( createTestRenderer(
'test-package', MODULE_WITH_PROVIDERS_PROGRAM, MODULE_WITH_PROVIDERS_DTS_PROGRAM); 'test-package', MODULE_WITH_PROVIDERS_PROGRAM, MODULE_WITH_PROVIDERS_DTS_PROGRAM);
@ -526,7 +534,7 @@ describe('Renderer', () => {
{specifier: '@angular/core', qualifier: 'ɵngcc1'}, {specifier: '@angular/core', qualifier: 'ɵngcc1'},
{specifier: 'some-library', qualifier: 'ɵngcc2'}, {specifier: 'some-library', qualifier: 'ɵngcc2'},
], ],
jasmine.anything()); bundle.dts !.file);
// The following expectation checks that we do not mistake `ModuleWithProviders` types // The following expectation checks that we do not mistake `ModuleWithProviders` types