diff --git a/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts b/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts index 1aface1702e4..0ffaf915ecd4 100644 --- a/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts +++ b/tests/legacy-cli/e2e/tests/commands/add/version-specifier.ts @@ -1,18 +1,18 @@ import { appendFile } from 'node:fs/promises'; -import { expectFileToMatch, rimraf } from '../../../utils/fs'; +import { expectFileToMatch } from '../../../utils/fs'; import { getActivePackageManager, uninstallPackage } from '../../../utils/packages'; import { ng } from '../../../utils/process'; import { isPrereleaseCli } from '../../../utils/project'; export default async function () { // forcibly remove in case another test doesn't clean itself up. - await rimraf('node_modules/@angular/localize'); + await uninstallPackage('@angular/localize'); - // If using npm, enable the force option to allow testing the output behavior of the + // If using npm, enable the legacy-peer-deps option to allow testing the output behavior of the // `ng add` command itself and not the behavior of npm which may otherwise fail depending // on the npm version in use and the version specifier supplied in each test. if (getActivePackageManager() === 'npm') { - await appendFile('.npmrc', '\nforce=true\n'); + await appendFile('.npmrc', '\nlegacy-peer-deps=true\n'); } const tag = (await isPrereleaseCli()) ? '@next' : '';