Skip to content

Commit 8089a3f

Browse files
clydinvikerman
authored andcommitted
fix(@angular-devkit/core): support writing an empty object workspace
1 parent b2262e9 commit 8089a3f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/angular_devkit/core/src/workspace/core_spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ describe('readWorkspace', () => {
289289
});
290290

291291
describe('writeWorkspace', () => {
292-
xit('attempts to write to specified file path', async (done) => {
292+
it('attempts to write to specified file path', async (done) => {
293293
const requestedPath = '/path/to/workspace/angular.json';
294294

295295
let writtenPath: string | undefined;

packages/angular_devkit/core/src/workspace/json/writer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function convertJsonWorkspace(workspace: WorkspaceDefinition, schema?: string):
5555
$schema: schema || './node_modules/@angular/cli/lib/config/schema.json',
5656
version: 1,
5757
...workspace.extensions,
58-
projects: convertJsonProjectCollection(workspace.projects),
58+
projects: workspace.projects ? convertJsonProjectCollection(workspace.projects) : {},
5959
};
6060

6161
return obj;

0 commit comments

Comments
 (0)