Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/angular/cli/src/commands/add/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export default class AddCommandModule
await packageManager.add(
packageIdentifier.toString(),
'none',
savePackage !== 'dependencies',
savePackage === 'devDependencies',
false,
true,
{
Expand Down
10 changes: 8 additions & 2 deletions tests/e2e/tests/commands/add/add-material.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { assertIsError } from '../../../utils/utils';
import { expectFileToMatch, rimraf } from '../../../utils/fs';
import { readFile, rimraf } from '../../../utils/fs';
import { getActivePackageManager, uninstallPackage } from '../../../utils/packages';
import { ng } from '../../../utils/process';
import { isPrereleaseCli } from '../../../utils/project';
import { appendFile } from 'node:fs/promises';
import assert from 'node:assert';

export default async function () {
// forcibly remove in case another test doesn't clean itself up
Expand Down Expand Up @@ -32,7 +33,12 @@ export default async function () {
'--verbose',
'--skip-confirmation',
);
await expectFileToMatch('package.json', /@angular\/material/);

const { dependencies } = JSON.parse(await readFile('package.json'));
assert.ok(
dependencies['@angular/material'],
'`@angular/material` was not found added to dependencies',
);

// Clean up existing cdk package
// Not doing so can cause adding material to fail if an incompatible cdk is present
Expand Down