Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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.
Expand Down
Loading