Skip to content

Commit 9b9ae1a

Browse files
committed
Revert "test: Introduce delay for file write to minimize flakiness"
This reverts commit 533fd21.
1 parent 533fd21 commit 9b9ae1a

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

tests/legacy-cli/e2e/tests/vite/reuse-dep-optimization-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ export default async function () {
3939
['serve', '--port=0'],
4040
/Hash is consistent\. Skipping/,
4141
// Use CI:0 to force caching
42-
{ DEBUG: 'vite:deps', CI: '0', NO_COLOR: 'true' },
42+
{ DEBUG: 'vite:deps', CI: '0' },
4343
);
4444
}

tests/legacy-cli/e2e/tests/vite/ssr-new-dep-optimization.ts

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import assert from 'node:assert';
2-
import { setTimeout } from 'node:timers/promises';
3-
import {
4-
execAndWaitForOutputToMatch,
5-
ng,
6-
waitForAnyProcessOutputToMatch,
7-
} from '../../utils/process';
2+
import { ng, waitForAnyProcessOutputToMatch } from '../../utils/process';
83
import { installWorkspacePackages, uninstallPackage } from '../../utils/packages';
9-
import { useSha } from '../../utils/project';
4+
import { ngServe, useSha } from '../../utils/project';
105
import { getGlobalVariable } from '../../utils/env';
116
import { readFile, writeFile } from '../../utils/fs';
12-
import { findFreePort } from '../../utils/network';
137

148
export default async function () {
159
assert(
@@ -27,27 +21,21 @@ export default async function () {
2721
await useSha();
2822
await installWorkspacePackages();
2923

30-
// The Node.js specific module should not be found
31-
const port = await findFreePort();
32-
await execAndWaitForOutputToMatch(
33-
'ng',
34-
['serve', '--port', port.toString()],
35-
/Application bundle generation complete/,
36-
{ CI: '0', NO_COLOR: 'true' },
37-
);
24+
const port = await ngServe();
3825
await validateResponse('/', /Hello,/);
3926

40-
const appConfigContentsUpdated = `
41-
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
42-
${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')}
43-
`;
44-
4527
await Promise.all([
4628
waitForAnyProcessOutputToMatch(
4729
/new dependencies optimized: @angular\/platform-browser\/animations\/async/,
4830
6000,
4931
),
50-
setTimeout(200).then(() => writeFile('src/app/app.config.ts', appConfigContentsUpdated)),
32+
writeFile(
33+
'src/app/app.config.ts',
34+
`
35+
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
36+
${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')}
37+
`,
38+
),
5139
]);
5240

5341
// Verify the app still works.

0 commit comments

Comments
 (0)