Jest: Change -w alias to --watch instead of --maxWorkers

Created on 7 Feb 2018  路  3Comments  路  Source: facebook/jest

I don't think --maxWorkers is as frequently used as --watch

And -w corresponds more to watch

--maxWorkers could be -max, -m or whatever

Discussion

Most helpful comment

Agree with @caub

The watch option is something you'll find yourself typing in the terminal much more than maxWorkers which is something you'll usually preconfigure in a script.

Also, other test runners use this alias.

@thymikee I find it confusing when an alias is calling two different options depends on its type.

All 3 comments

This has already been discussed, but how about we check if the -w is a boolean or number and then decide which flag to apply? I recently caught myself on using -w 馃槄

Agree with @caub

The watch option is something you'll find yourself typing in the terminal much more than maxWorkers which is something you'll usually preconfigure in a script.

Also, other test runners use this alias.

@thymikee I find it confusing when an alias is calling two different options depends on its type.

I don't think we'll be making a breaking change like this which could cause quite unexpected changes to people who run Jest in various different environments. I recommend making a shortcut like w in your scripts section and running yarn w which is even shorter :)

Was this page helpful?
0 / 5 - 0 ratings