Skip to content

Commit da1df2d

Browse files
committed
test: disable colors in vite tests
This forcefully removes the colors.
1 parent c8955ff commit da1df2d

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function () {
1919
['serve', '--port', `${port}`],
2020
/bundle generation complete/,
2121
// Use CI:0 to force caching
22-
{ DEBUG: 'vite:deps', CI: '0' },
22+
{ DEBUG: 'vite:deps', CI: '0', NO_COLOR: 'true' },
2323
);
2424

2525
// Wait for vite to write to FS and stablize.
@@ -33,7 +33,6 @@ export default async function () {
3333
// Terminate the dev-server
3434
await killAllProcesses();
3535

36-
// The Node.js specific module should not be found
3736
await execAndWaitForOutputToMatch(
3837
'ng',
3938
['serve', '--port=0'],

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import assert from 'node:assert';
2-
import { setTimeout } from 'node:timers/promises';
3-
import { ng, waitForAnyProcessOutputToMatch } from '../../utils/process';
2+
import {
3+
execAndWaitForOutputToMatch,
4+
ng,
5+
waitForAnyProcessOutputToMatch,
6+
} from '../../utils/process';
47
import { installWorkspacePackages, uninstallPackage } from '../../utils/packages';
5-
import { ngServe, useSha } from '../../utils/project';
8+
import { useSha } from '../../utils/project';
69
import { getGlobalVariable } from '../../utils/env';
710
import { readFile, writeFile } from '../../utils/fs';
11+
import { findFreePort } from '../../utils/network';
812

913
export default async function () {
1014
assert(
@@ -22,20 +26,27 @@ export default async function () {
2226
await useSha();
2327
await installWorkspacePackages();
2428

25-
const port = await ngServe();
29+
const port = await findFreePort();
30+
await execAndWaitForOutputToMatch(
31+
'ng',
32+
['serve', '--port', port.toString()],
33+
/Application bundle generation complete/,
34+
{ CI: '0', NO_COLOR: 'true' },
35+
);
2636
await validateResponse('/', /Hello,/);
2737

28-
const appConfigContentsUpdated = `
29-
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
30-
${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')}
31-
`;
32-
3338
await Promise.all([
3439
waitForAnyProcessOutputToMatch(
3540
/new dependencies optimized: @angular\/platform-browser\/animations\/async/,
3641
6000,
3742
),
38-
setTimeout(200).then(() => writeFile('src/app/app.config.ts', appConfigContentsUpdated)),
43+
writeFile(
44+
'src/app/app.config.ts',
45+
`
46+
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
47+
${(await readFile('src/app/app.config.ts')).replace('provideRouter(routes),', 'provideAnimationsAsync(), provideRouter(routes),')}
48+
`,
49+
),
3950
]);
4051

4152
// Verify the app still works.

0 commit comments

Comments
 (0)