diff --git a/packages/angular_devkit/core/src/workspace/json/reader.ts b/packages/angular_devkit/core/src/workspace/json/reader.ts index 71035e28b08d..75038787154b 100644 --- a/packages/angular_devkit/core/src/workspace/json/reader.ts +++ b/packages/angular_devkit/core/src/workspace/json/reader.ts @@ -190,11 +190,7 @@ function parseProject( const projectNodeValue = getNodeValue(projectNode); if (!('root' in projectNodeValue)) { - // TODO(alan-agius4): change this to error in v15. - context.warn( - `Project "${projectName}" is missing a required property "root". This will become an error in the next major version.`, - projectNodeValue, - ); + throw new Error(`Project "${projectName}" is missing a required property "root".`); } for (const [name, value] of Object.entries(projectNodeValue)) { diff --git a/packages/angular_devkit/core/src/workspace/json/reader_spec.ts b/packages/angular_devkit/core/src/workspace/json/reader_spec.ts index 0d5728770a03..5b80cc50d92b 100644 --- a/packages/angular_devkit/core/src/workspace/json/reader_spec.ts +++ b/packages/angular_devkit/core/src/workspace/json/reader_spec.ts @@ -148,11 +148,8 @@ describe('readJsonWorkpace Parsing', () => { } `); - const consoleWarnSpy = spyOn(console, 'warn').and.callFake(() => undefined); - await expectAsync(readJsonWorkspace('', host)); - - expect(consoleWarnSpy).toHaveBeenCalledWith( - `Project "foo" is missing a required property "root". This will become an error in the next major version.`, + await expectAsync(readJsonWorkspace('', host)).toBeRejectedWithError( + /Project "foo" is missing a required property "root"/, ); }); });