@@ -28,6 +28,9 @@ describe('Workspace Schematic', () => {
28
28
const files = tree . files ;
29
29
expect ( files ) . toEqual (
30
30
jasmine . arrayContaining ( [
31
+ '/.vscode/extensions.json' ,
32
+ '/.vscode/launch.json' ,
33
+ '/.vscode/tasks.json' ,
31
34
'/.editorconfig' ,
32
35
'/angular.json' ,
33
36
'/.gitignore' ,
@@ -66,6 +69,9 @@ describe('Workspace Schematic', () => {
66
69
const files = tree . files ;
67
70
expect ( files ) . toEqual (
68
71
jasmine . arrayContaining ( [
72
+ '/.vscode/extensions.json' ,
73
+ '/.vscode/launch.json' ,
74
+ '/.vscode/tasks.json' ,
69
75
'/angular.json' ,
70
76
'/.gitignore' ,
71
77
'/package.json' ,
@@ -106,4 +112,24 @@ describe('Workspace Schematic', () => {
106
112
expect ( compilerOptions . strict ) . toBe ( true ) ;
107
113
expect ( angularCompilerOptions . strictTemplates ) . toBe ( true ) ;
108
114
} ) ;
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
+ } ) ;
109
135
} ) ;
0 commit comments