kentcdodds / nps-utils

Utilities for http://npm.im/nps (npm-package-scripts)
https://doclets.io/kentcdodds/nps-utils/master
MIT License
101 stars 23 forks source link

feature: nps.retry(n, cmd) #25

Closed billiegoose closed 6 years ago

billiegoose commented 6 years ago

I'm currently in a heated battle with some flaky tests. One of the dozen approaches I'm taking is stringing a bunch of the test command together with short-circuit or, e.g:

(jest --ci --coverage && codecov) || (jest --ci --coverage && codecov) || (jest --ci --coverage && codecov)

and I was wondering if you'd accept a PR adding a feature that does that?

kentcdodds commented 6 years ago

Hey @wmhilton! Why don't you go ahead and write a utility function in your own project and use that instead. I think that's not a super common utility and would prefer that this only be used for utilities that many people will use.

If you'd like, once you've written the utility, you can add an example of it in the docs so others can benefit from it.

I'm going to go ahead and close this for now though. Thanks!