diff --git a/tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts b/tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts index d330cbf8f75d..d8e9d61f79e2 100644 --- a/tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts +++ b/tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts @@ -1,5 +1,4 @@ import assert from 'node:assert'; -import { setTimeout } from 'node:timers/promises'; import { ng, waitForAnyProcessOutputToMatch } from '../../utils/process'; import { installWorkspacePackages, uninstallPackage } from '../../utils/packages'; import { ngServe, useSha } from '../../utils/project'; @@ -25,17 +24,18 @@ export default async function () { const port = await ngServe(); await validateResponse('/', /Hello,/); - const appConfigContentsUpdated = ` - import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; - ${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')} - `; - await Promise.all([ waitForAnyProcessOutputToMatch( /new dependencies optimized: @angular\/platform-browser\/animations\/async/, 6000, ), - setTimeout(200).then(() => writeFile('src/app/app.config.ts', appConfigContentsUpdated)), + writeFile( + 'src/app/app.config.ts', + ` + import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; + ${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')} + `, + ), ]); // Verify the app still works.