@@ -28,6 +28,9 @@ describe('Workspace Schematic', () => {
2828 const files = tree . files ;
2929 expect ( files ) . toEqual (
3030 jasmine . arrayContaining ( [
31+ '/.vscode/extensions.json' ,
32+ '/.vscode/launch.json' ,
33+ '/.vscode/tasks.json' ,
3134 '/.editorconfig' ,
3235 '/angular.json' ,
3336 '/.gitignore' ,
@@ -66,6 +69,9 @@ describe('Workspace Schematic', () => {
6669 const files = tree . files ;
6770 expect ( files ) . toEqual (
6871 jasmine . arrayContaining ( [
72+ '/.vscode/extensions.json' ,
73+ '/.vscode/launch.json' ,
74+ '/.vscode/tasks.json' ,
6975 '/angular.json' ,
7076 '/.gitignore' ,
7177 '/package.json' ,
@@ -106,4 +112,24 @@ describe('Workspace Schematic', () => {
106112 expect ( compilerOptions . strict ) . toBe ( true ) ;
107113 expect ( angularCompilerOptions . strictTemplates ) . toBe ( true ) ;
108114 } ) ;
115+
116+ it ( 'should add vscode testing configuration' , async ( ) => {
117+ const tree = await schematicRunner
118+ . runSchematicAsync ( 'workspace' , { ...defaultOptions } )
119+ . toPromise ( ) ;
120+ const { configurations } = parseJson ( tree . readContent ( '.vscode/launch.json' ) . toString ( ) ) ;
121+ expect ( configurations ) . toContain ( jasmine . objectContaining ( { name : 'ng test' } ) ) ;
122+ const { tasks } = parseJson ( tree . readContent ( '.vscode/tasks.json' ) . toString ( ) ) ;
123+ expect ( tasks ) . toContain ( jasmine . objectContaining ( { type : 'npm' , script : 'test' } ) ) ;
124+ } ) ;
125+
126+ it ( 'should not add vscode testing configuration when using minimal' , async ( ) => {
127+ const tree = await schematicRunner
128+ . runSchematicAsync ( 'workspace' , { ...defaultOptions , minimal : true } )
129+ . toPromise ( ) ;
130+ const { configurations } = parseJson ( tree . readContent ( '.vscode/launch.json' ) . toString ( ) ) ;
131+ expect ( configurations ) . not . toContain ( jasmine . objectContaining ( { name : 'ng test' } ) ) ;
132+ const { tasks } = parseJson ( tree . readContent ( '.vscode/tasks.json' ) . toString ( ) ) ;
133+ expect ( tasks ) . not . toContain ( jasmine . objectContaining ( { type : 'npm' , script : 'test' } ) ) ;
134+ } ) ;
109135} ) ;
0 commit comments