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

vitest with Project Crystal does not work with watch flag #23185

Closed
1 of 4 tasks
nzacca opened this issue May 4, 2024 · 0 comments · Fixed by #23298
Closed
1 of 4 tasks

vitest with Project Crystal does not work with watch flag #23185

nzacca opened this issue May 4, 2024 · 0 comments · Fixed by #23298
Assignees
Labels
scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@nzacca
Copy link

nzacca commented May 4, 2024

Current Behavior

When Project Crystal is used with vitest, the command that vitest generates uses vitest run which prevents entering watch mode.

Expected Behavior

Watch mode should work when passed on the command line.

GitHub Repo

No response

Steps to Reproduce

  1. Run npx nx test app --watch
  2. Note that a single run is performed instead of entering watch mode.

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : win32-x64
npm    : 10.5.2

nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/devkit         : 18.3.4
@nx/esbuild        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/node           : 18.3.4
@nx/plugin         : 18.3.4
@nrwl/tao          : 18.3.4
@nx/vite           : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/vite/plugin
---------------------------------------

Failure Logs

No response

Package Manager Version

10.5.2

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Issue appears to be here:

command: `vitest run`,

Since this is using run, this implies --watch=false and cannot be overridden.

@FrozenPandaz FrozenPandaz added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label May 9, 2024
Coly010 added a commit that referenced this issue May 10, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->
We currently do not handle passing `--watch` when running inferred
`vitest` commands

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should support handling `--watch`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23185
FrozenPandaz pushed a commit that referenced this issue May 13, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->
We currently do not handle passing `--watch` when running inferred
`vitest` commands

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should support handling `--watch`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23185

(cherry picked from commit 7cf09a6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants