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

Jest builder is missing "--coverage" and "--no-coverage" options. #3005

Closed
zbream opened this issue May 13, 2020 · 2 comments · Fixed by #3010
Closed

Jest builder is missing "--coverage" and "--no-coverage" options. #3005

zbream opened this issue May 13, 2020 · 2 comments · Fixed by #3010
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@zbream
Copy link

zbream commented May 13, 2020

Expected Behavior

Working in an NX Workspace using Angular and Jest, I cannot use the vscode-jest extension to run and debug unit tests.

It looks like this was possible in the past (comment, pull request), however this no longer works.

Current Behavior

A recent change removed support for the --coverage argument:

#2569

However, the extension will automatically pass in --coverage or --no-coverage depending on configuration, it looks like we don't have control over that. The NX Jest builder should support these arguments.

Failure Information (for bugs)

After configuring the extension to use ng test, the following error is reported in the output console:

image

Steps to Reproduce

  1. Create a new NX repo using Jest as the unit test runner.
  2. Configure VSCode according to this comment.
  3. Check the Output console for Jest extension.

Context

  @nrwl/angular : 9.1.4
  @nrwl/cli : 9.1.4
  @nrwl/cypress : 9.1.4
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 9.1.4
  @nrwl/linter : Not Found
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.1.4
  @nrwl/web : Not Found
  @nrwl/workspace : 9.1.4
  typescript : 3.7.5

vscode-jest: 3.2.0

Other

Is there a reason that the Jest NX builder has its own API over Jest? Would it be possible for it to pass along any config options to the underlying CLI? I'm not overly familiar with builders, this might not be possible.

@FrozenPandaz FrozenPandaz added scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug labels May 15, 2020
@FrozenPandaz
Copy link
Collaborator

Thank you for tracking the issue down 👍.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants