Bash/Zsh and Nushell scripts for targeting Jest coverage to one or more files with flag support for watching the files etc.
How to use it with Bash/Zsh:
- Copy the content of the first file to your
.bashrcor.zshrc - Open a new terminal
- Run
jestc src/test-file.spec.tsorjestc --watch src/test-file-1.spec.ts src/test-file-2.spec.ts
How to use it with Nushell:
- Save the contents of the
.nufile to something likescripts/jest-coverage.nu - Load it in Nushell:
use scripts/jest-coverage.nu *- Open a new terminal
- Run
jestc src/test-file.spec.tsorjestc --watch src/test-file-1.spec.ts src/test-file-2.spec.ts