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 watch does not respond to key presses on Windows #27914

Open
1 of 4 tasks
GaryB432 opened this issue Sep 13, 2024 · 0 comments
Open
1 of 4 tasks

Jest watch does not respond to key presses on Windows #27914

GaryB432 opened this issue Sep 13, 2024 · 0 comments

Comments

@GaryB432
Copy link

GaryB432 commented Sep 13, 2024

Current Behavior

I have to Ctrl+C to Terminate batch job (Y/N) out of npx nx test my-proj --watch and cannot use any of the keys shown below, .

Running npx jest --watch in the project root works as expected, listing and responding to the keys shown below, e.g. Press a to run all tests or Press q to quit watch mode wlog.

Expected Behavior

npx nx test my-project --watch in a brand-new workspace should watch tests the same way npx jext --watch in the project root does.

GitHub Repo

No response

Steps to Reproduce

npx create-nx-workspace@latest ws -y --workspaceType=integrated --preset=apps --ci=skip
cd ws
npx nx g @nx/js:library --name=my-proj --directory=libs/my-proj --projectNameAndRootFormat=as-provided --unitTestRunner=jest --bundler=none
npx nx test my-proj --watch
# observe the jest watching options are not displayed
# project is being watched properly but the jest features are not working

This works as expected

cd .\libs\my-proj\
npx jest --watch
# observe watch usage and keypress handling
cd ../..

Nx Report

Node           : 20.17.0
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.8.2

nx                 : 19.7.3
@nx/js             : 19.7.3
@nx/jest           : 19.7.3
@nx/linter         : 19.7.3
@nx/eslint         : 19.7.3
@nx/workspace      : 19.7.3
@nx/devkit         : 19.7.3
@nx/eslint-plugin  : 19.7.3
@nrwl/tao          : 19.7.3
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

Watch Usage

Watch Usage
 › Press a to run all tests.
 › Press f to run only failed tests.
 › Press p to filter by a filename regex pattern.
 › Press t to filter by a test name regex pattern.
 › Press q to quit watch mode.
 › Press Enter to trigger a test run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant