diff --git a/src/material/schematics/ng-add/index.spec.ts b/src/material/schematics/ng-add/index.spec.ts index 7d686f56609d..858f73a14ea8 100644 --- a/src/material/schematics/ng-add/index.spec.ts +++ b/src/material/schematics/ng-add/index.spec.ts @@ -239,13 +239,15 @@ describe('ng-add schematic', () => { // Simulate the case where a developer uses `ng-add` on an Angular CLI project which already // explicitly uses the `BrowserAnimationsModule`. It would be wrong to forcibly change // to noop animations. - const fileContent = addModuleImportToRootModule( + addModuleImportToRootModule( appTree, 'BrowserAnimationsModule', '@angular/platform-browser/animations', project, ); + const fileContent = getFileContent(appTree, '/projects/material/src/app/app.module.ts'); + expect(fileContent).not.toContain( 'NoopAnimationsModule', 'Expected the project app module to not import the "NoopAnimationsModule".',