Skip to content

Commit 25ef9e7

Browse files
alan-agius4dgp1130
authored andcommitted
test: re-enable Angular material tests
Now that `@angular/material` has been released as `15.0.0-next` we can re-enable these tests.
1 parent c312952 commit 25ef9e7

File tree

3 files changed

+23
-32
lines changed

3 files changed

+23
-32
lines changed

tests/legacy-cli/e2e/tests/build/material.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import { isPrereleaseCli, updateJsonFile } from '../../utils/project';
77
const snapshots = require('../../ng-snapshot/package.json');
88

99
export default async function () {
10-
// TODO(alanagius): re-enable once material version 15.0.0-next is out.
11-
return;
12-
1310
let tag = (await isPrereleaseCli()) ? '@next' : '';
1411
await ng('add', `@angular/material${tag}`, '--skip-confirmation');
1512

tests/legacy-cli/e2e/tests/commands/add/add-material.ts

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,31 @@ import { ng } from '../../../utils/process';
55
import { isPrereleaseCli } from '../../../utils/project';
66

77
export default async function () {
8-
// TODO(alanagius): re-enable material once version 15.0.0-next is out.
9-
return;
8+
// forcibly remove in case another test doesn't clean itself up
9+
await rimraf('node_modules/@angular/material');
1010

11-
// // forcibly remove in case another test doesn't clean itself up
12-
// await rimraf('node_modules/@angular/material');
11+
const tag = (await isPrereleaseCli()) ? '@next' : '';
1312

14-
// const tag = (await isPrereleaseCli()) ? '@next' : '';
13+
try {
14+
await ng('add', `@angular/material${tag}`, '--unknown', '--skip-confirmation');
15+
} catch (error) {
16+
assertIsError(error);
17+
if (!error.message.includes(`Unknown option: '--unknown'`)) {
18+
throw error;
19+
}
20+
}
1521

16-
// try {
17-
// await ng('add', `@angular/material${tag}`, '--unknown', '--skip-confirmation');
18-
// } catch (error) {
19-
// assertIsError(error);
20-
// if (!error.message.includes(`Unknown option: '--unknown'`)) {
21-
// throw error;
22-
// }
23-
// }
22+
await ng(
23+
'add',
24+
`@angular/material${tag}`,
25+
'--theme',
26+
'custom',
27+
'--verbose',
28+
'--skip-confirmation',
29+
);
30+
await expectFileToMatch('package.json', /@angular\/material/);
2431

25-
// await ng(
26-
// 'add',
27-
// `@angular/material${tag}`,
28-
// '--theme',
29-
// 'custom',
30-
// '--verbose',
31-
// '--skip-confirmation',
32-
// );
33-
// await expectFileToMatch('package.json', /@angular\/material/);
34-
35-
// // Clean up existing cdk package
36-
// // Not doing so can cause adding material to fail if an incompatible cdk is present
37-
// await uninstallPackage('@angular/cdk');
32+
// Clean up existing cdk package
33+
// Not doing so can cause adding material to fail if an incompatible cdk is present
34+
await uninstallPackage('@angular/cdk');
3835
}

tests/legacy-cli/e2e/tests/misc/invalid-schematic-dependencies.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import { installPackage, uninstallPackage } from '../../utils/packages';
44
import { isPrereleaseCli } from '../../utils/project';
55

66
export default async function () {
7-
// TODO(alanagius): re-enable once material version 15.0.0-next is out.
8-
return;
9-
107
// Must publish old version to local registry to allow install. This is especially important
118
// for release commits as npm will try to request tooling packages that are not on the npm registry yet
129
await publishOutdated('@schematics/angular@7');

0 commit comments

Comments
 (0)