Skip to content

Commit dd65a9d

Browse files
committed
Read angular.json via fs instead of import
1 parent 43beef6 commit dd65a9d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

e2e-tests/tests/angular-17.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
getWizardCommand,
1212
modifyFile,
1313
} from '../utils';
14+
import * as fs from 'fs';
1415
import * as path from 'path';
1516
import { TEST_ARGS } from '../utils';
1617
import { test, expect, describe, beforeAll, afterAll, it } from 'vitest';
@@ -224,12 +225,14 @@ function checkAngularProject(
224225
]);
225226
});
226227

227-
test('angular.json is updated correctly', async () => {
228+
test('angular.json is updated correctly', () => {
228229
const angularJsonFile = path.resolve(projectDir, 'angular.json');
229230
checkFileExists(angularJsonFile);
230231

231-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
232-
const angularJson = (await import(angularJsonFile)) as Record<string, any>;
232+
const angularJson = JSON.parse(
233+
fs.readFileSync(angularJsonFile, 'utf-8'),
234+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
235+
) as Record<string, any>;
233236

234237
// eslint-disable-next-line @typescript-eslint/no-explicit-any
235238
for (const [, project] of Object.entries(

e2e-tests/tests/angular-19.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
getWizardCommand,
1212
modifyFile,
1313
} from '../utils';
14+
import * as fs from 'fs';
1415
import * as path from 'path';
1516
import { TEST_ARGS } from '../utils';
1617
import { test, expect, describe, beforeAll, afterAll, it } from 'vitest';
@@ -222,12 +223,14 @@ function checkAngularProject(
222223
]);
223224
});
224225

225-
test('angular.json is updated correctly', async () => {
226+
test('angular.json is updated correctly', () => {
226227
const angularJsonFile = path.resolve(projectDir, 'angular.json');
227228
checkFileExists(angularJsonFile);
228229

229-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
230-
const angularJson = (await import(angularJsonFile)) as Record<string, any>;
230+
const angularJson = JSON.parse(
231+
fs.readFileSync(angularJsonFile, 'utf-8'),
232+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
233+
) as Record<string, any>;
231234

232235
// eslint-disable-next-line @typescript-eslint/no-explicit-any
233236
for (const [, project] of Object.entries(

0 commit comments

Comments
 (0)