thefuck
thefuck copied to clipboard
Npx: Create npx_add_npx_to_command.py
Add npx
to command
Prefixes npx
to command name to run locally installed npm
commands, also corrects misspelled npx
commands.
Example | |
---|---|
jest |
npx jest |
npx jeet |
npx jest |
jeet |
npx jest |
I am not sure how to write tests for the code, any help would be appreciated.
Thanks for contributing, @KartikSoneji! Apologies for the delay.
This is looking good. Regarding tests, you can base off of any existing test and write unit tests for match
and get_new_command
. Take the following as an example:
https://github.com/nvbn/thefuck/blob/11b70526f72339bcce0beefa1665c74bb06e18b3/tests/rules/test_git_commit_add.py#L1-L38