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
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
}<% if (!minimal) { %>,
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
}<% } %>
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
}
}
},
}<% if (!minimal) { %>,
{
"type": "npm",
"script": "test",
Expand All @@ -37,6 +37,6 @@
}
}
}
}
}<% } %>
]
}
26 changes: 26 additions & 0 deletions packages/schematics/angular/workspace/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ describe('Workspace Schematic', () => {
const files = tree.files;
expect(files).toEqual(
jasmine.arrayContaining([
'/.vscode/extensions.json',
'/.vscode/launch.json',
'/.vscode/tasks.json',
'/.editorconfig',
'/angular.json',
'/.gitignore',
Expand Down Expand Up @@ -66,6 +69,9 @@ describe('Workspace Schematic', () => {
const files = tree.files;
expect(files).toEqual(
jasmine.arrayContaining([
'/.vscode/extensions.json',
'/.vscode/launch.json',
'/.vscode/tasks.json',
'/angular.json',
'/.gitignore',
'/package.json',
Expand Down Expand Up @@ -106,4 +112,24 @@ describe('Workspace Schematic', () => {
expect(compilerOptions.strict).toBe(true);
expect(angularCompilerOptions.strictTemplates).toBe(true);
});

it('should add vscode testing configuration', async () => {
const tree = await schematicRunner
.runSchematicAsync('workspace', { ...defaultOptions })
.toPromise();
const { configurations } = parseJson(tree.readContent('.vscode/launch.json').toString());
expect(configurations).toContain(jasmine.objectContaining({ name: 'ng test' }));
const { tasks } = parseJson(tree.readContent('.vscode/tasks.json').toString());
expect(tasks).toContain(jasmine.objectContaining({ type: 'npm', script: 'test' }));
});

it('should not add vscode testing configuration when using minimal', async () => {
const tree = await schematicRunner
.runSchematicAsync('workspace', { ...defaultOptions, minimal: true })
.toPromise();
const { configurations } = parseJson(tree.readContent('.vscode/launch.json').toString());
expect(configurations).not.toContain(jasmine.objectContaining({ name: 'ng test' }));
const { tasks } = parseJson(tree.readContent('.vscode/tasks.json').toString());
expect(tasks).not.toContain(jasmine.objectContaining({ type: 'npm', script: 'test' }));
});
});