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

camelcase args are not supported in angular cli #923

Closed
vhdirk opened this issue Oct 17, 2022 · 2 comments · Fixed by #1034
Closed

camelcase args are not supported in angular cli #923

vhdirk opened this issue Oct 17, 2022 · 2 comments · Fixed by #1034

Comments

@vhdirk
Copy link

vhdirk commented Oct 17, 2022

Environment

  1. vscode-jest version: 5.0.0
  2. node -v: v18.10.0
  3. npm -v or yarn --version: yarn 1.22.19
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected):
webapp@1.7.0-SNAPSHOT /home/dirk/devel/webapp
├─┬ @angular-builders/jest@14.0.0
│ ├─┬ jest-preset-angular@12.1.0
│ │ └── jest@28.1.3 deduped
│ └── jest@28.1.3 deduped
├─┬ jest-extended@3.0.1
│ └── jest@28.1.3 deduped
├─┬ jest-mock-console@2.0.0
│ └── jest@28.1.3 deduped
├─┬ jest-mock-extended@2.0.7
│ └── jest@28.1.3 deduped
├─┬ jest-preset-angular@12.2.0
│ └── jest@28.1.3 deduped
├── jest@28.1.3
└─┬ ts-jest@28.0.7
  └── jest@28.1.3 deduped
  1. your vscode-jest settings if customized:
    • jest.jestCommandLine? yarn run test --bail --max-workers=2
    • jest.autoRun? [fill]
    • anything else that you think might be relevant? [fill]
  2. Operating system: Debian testing

Prerequisite

  • are you able to run jest test from the command line? yes
  • how do you run your tests from the command line? (for example: npm run test or node_modules/.bin/jest) yarn run test

Steps to Reproduce

Yarn run test is an alias for ng test, which, in my case, uses the jest builder from
https://github.com/just-jeb/angular-builders.

The relevant snippet from my angular.json is

        "test": {
          "builder": "@angular-builders/jest:run",
          "options": {
            "configPath": "src/jest.conf.js",
            "no-cache": true,
            "polyfills": ["src/polyfills.ts"],
            "tsConfig": "src/tsconfig.spec.json"
          }
        },

Jest supports both camelCase as dashed arguments. Angular CLI only supports dashed argument. vscode-jest uses camelcase.
While I understand this is not an issue originating from vscode-jest, the solution can be pretty simple and should not matter for those not using angular anyway.

See https://github.com/just-jeb/angular-builders/blob/master/MIGRATION.MD#jest-builder for more info

@ulrikdom
Copy link

ulrikdom commented Feb 7, 2023

It'd be great to this fixed. Haven't found any other good extensions that work with @angular-builders/jest.

@stefanrybacki
Copy link

Still not completely working: #1034 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants