Jest: Watch usages would be more intuitive if they were not case sensitive.

Created on 25 Feb 2019  ·  3Comments  ·  Source: facebook/jest

🐛 Bug Report

I often use the keyboard shortcuts a and u when writing tests. I made the mistake of pressing caps lock when typing a, and suddenly all shortcuts stopped working!
I understand that shortcuts are case sensitive, but making them insensitive would improve the developer experience.

Watch Usage
 › Press f to run only failed tests.
 › Press o to only run tests related to changed files.
 › Press p to filter by a filename regex pattern.
 › Press t to filter by a test name regex pattern.
 › Press u to update failing snapshots.
 › Press i to update failing snapshots interactively.
 › Press q to quit watch mode.
 › Press Enter to trigger a test run.

To Reproduce

Start jest in watch mode, press on caps lock, try to run all tests when pressing on a.

Expected behavior

I would expect all tests to run when typing A.

Thanks!!

Bug

All 3 comments

External watch plugins already use some upper case keys as triggers, e.g. https://github.com/rogeliog/jest-watch-select-projects (P). I think it's good to have a few more characters available (that are easy to type and memorize, not some obscure symbols) for cases like this.

External watch plugins already use some upper case keys as triggers,

I wrote two plugins that fight for the same key:

Having multiple characters would definitely help. I'm running out of keys that make sense.

I recently ran into the same issue as @jean343. A colleague had accidentally enabled caps lock and we spent a confusing minute trying to figure out why the watch commands weren't working.

I'm happy to send a PR to address this, but I'm not sure how the case of key-binding conflicts in the plugin ecosystem should be handled.

Was this page helpful?
0 / 5 - 0 ratings