@@ -5,34 +5,31 @@ import { ng } from '../../../utils/process';
5
5
import { isPrereleaseCli } from '../../../utils/project' ;
6
6
7
7
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' ) ;
10
10
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' : '' ;
13
12
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
+ }
15
21
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' , / @ a n g u l a r \/ m a t e r i a l / ) ;
24
31
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' ) ;
38
35
}
0 commit comments