New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use process.execSync
in favor of execa
in tests
#2917
Comments
👋 so this is probably mostly my fault. I got into a "everything should be async all the time" phase, and probably went a little overboard in extending that to tests as well. I'm totally supportive of making this change, as long as we have a plan. We have samples across 62 repos.... what's a good way to look at executing on updating them? Can we use |
Also a lot of function will now be synchronous, so not a easy mass-change if we just swap out the call. |
I dunno... Replace: = await exec( with = execSync( that, and deleting references to |
@JustinBeckwith @jkwlui in the Node.js tooling WG, we can't honestly figure out amongst a bunch of folks writing tooling what's actually broken in Mainly it would add less of an abstraction between our libraries and the Node.js platform, and in turn benefit the platform -- if we do find a bug with |
I'm 100% supportive. Just trying to figure out how to do it in a fell swoop :) |
https://github.com/bcoe/awesome-cross-platform-nodejs#known-issues ☝️ document I wrote years ago that outlines some of the edge-cases in |
there's a conversation happening here about the remaining deltas between execa and spawn: bcoe/awesome-cross-platform-nodejs#26 I would love to address these in the Node.js tooling initiative: https://github.com/nodejs/tooling |
So rolling list of feedback from me so far:
|
@JustinBeckwith the The additional
☝️ that's starting to get a bit verbose right? I don't love that the test assertions are so strict on exact matches any ways, I'd love to convert a couple tests to using snap-shots for CLI output, just to show what this methodology looks like -- it makes this type of assertions less fragile. |
Callin this one a win 🙃 |
process.execSync
is great for writing unit tests, it's what we use in Node.js itself.I think that
execa
,cross-spawn
, etc., address some historic inconsistencies in the Node.js API that we shouldn't be bumping into in simple assertions (and I'm not sure what, if any of the issues, continue to exist on Node.js > 6).The text was updated successfully, but these errors were encountered: