jscutlery/devkit

angular.json not updated when generating a new test setup

Qarun-Qadir-Bissoondial opened this issue · 0 comments

Expectation

Following the Angular CLI setup should create a new test setup

ng add @jscutlery/cypress-angular
ng g @jscutlery/cypress-angular:setup-ct --project my-project

npx ngcc

ng run my-project:ct

Actual Behaviour

Running ng g @jscutlery/cypress-angular:setup-ct --project my-project updates all necessary files but does not update angular.json. The console logs indicate that an update to angular.json was made but version control does not report this.
The new test setup project is not created in angular.json

This leads to my-project:ct not being found when running ng run my-project:ct

Versions

Here are my software versions:

Angular CLI: 10.2.3
Node: 12.22.1
OS: darwin x64

Angular: 10.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1002.3
@angular-devkit/build-angular   0.1002.3
@angular-devkit/core            10.2.3
@angular-devkit/schematics      10.2.3
@angular/cdk                    10.2.7
@angular/cli                    10.2.3
@angular/fire                   6.1.4
@angular/flex-layout            10.0.0-beta.32
@angular/material               10.2.7
@schematics/angular             10.2.3
@schematics/update              0.1002.3
rxjs                            6.6.7
typescript                      3.9.9

Cypress package version: 8.7.0
Cypress binary version: 8.7.0
Electron version: 14.1.0
Bundled Node version: 14.17.0

Logs

% npx ng g @jscutlery/cypress-angular:setup-ct --project webapp
CREATE cypress/plugins/index.ts (241 bytes)
CREATE cypress/support/index.ts (45 bytes)
CREATE src/sample.cy-spec.ts (336 bytes)
CREATE tsconfig.cypress.json (192 bytes)
UPDATE cypress.json (199 bytes)
UPDATE tsconfig.json (676 bytes)
UPDATE angular.json (4780 bytes)

% npx ngcc
% npx ng run webapp:ct
An unhandled exception occurred: Project "webapp" does not exist.
See "/private/var/folders/zc/klzx1g057xl567cy854bz3ph0000gn/T/ng-KGmdeg/angular-errors.log" for further details.

Opening up the log file, we get:

[error] Error: Project "webapp" does not exist.
    at WorkspaceNodeModulesArchitectHost.findProjectTarget (/Users/qarunqb/work/webapp/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:123:19)
    at WorkspaceNodeModulesArchitectHost.getBuilderNameForTarget (/Users/qarunqb/work/webapp/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:24:39)
    at RunCommand.runSingleTarget (/Users/qarunqb/work/webapp/node_modules/@angular/cli/models/architect-command.js:179:55)
    at RunCommand.runArchitectTarget (/Users/qarunqb/work/webapp/node_modules/@angular/cli/models/architect-command.js:222:35)
    at RunCommand.run (/Users/qarunqb/work/webapp/node_modules/@angular/cli/commands/run-impl.js:15:25)
    at RunCommand.validateAndRun (/Users/qarunqb/work/webapp/node_modules/@angular/cli/models/command.js:134:39)
    at async Object.runCommand (/Users/qarunqb/work/webapp/node_modules/@angular/cli/models/command-runner.js:198:24)
    at async default_1 (/Users/qarunqb/work/webapp/node_modules/@angular/cli/lib/cli/index.js:59:31)