Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before Node
15.13.0
(link to PR), thetimeout
was only available inexecFile()
andexec()
but not inspawn()
, which is used by Execa.Execa implemented its own
timeout
option to fix this. That option probably won't be needed after support for Node15.13.0
is dropped.In the meantime, the
timeout
option added tochild_process.spawn()
introduces the following inconsistent behavior in Execa depending on the Node.js version:<15.13.0
, using an invalidtimeout
(such as a negative integer) will throw an exception, using Execa's validation logic>=15.13.0
, it will return a rejected promise instead, usingchild_process.spawn()
validation logicThis PR fixes this inconsistency by moving Execa's validation logic earlier, before
child_process.spawn()
is called.CI tests are failing due to #462.