Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular.json not updated when generating a new test setup #164

Open
Qarun-Qadir-Bissoondial opened this issue Jan 20, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Qarun-Qadir-Bissoondial

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)
@edbzn edbzn added the bug Something isn't working label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants