Skip to content
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

Add node option #804

Merged
merged 1 commit into from Feb 8, 2024
Merged

Add node option #804

merged 1 commit into from Feb 8, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Feb 8, 2024

Fixes #781.

@@ -288,6 +282,8 @@ export function execaSync(rawFile, rawArgs, rawOptions) {
};
}

const normalizeSyncOptions = (options = {}) => options.node && !options.ipc ? {...options, ipc: false} : options;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node: true can be used with synchronous methods, but ipc: true cannot.
Therefore, ipc: true is not added when using node: true with synchronous methods.

};

test('Can pass null to options', testNullOptions, execa);
test('Can pass null to options - sync', testNullOptions, execaSync);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was documenting that execa('file', [...args], null) currently does not throw.
This PR breaks this behavior. We could still support passing null, but it feels like this is not something we should support, and it is undocumented.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should not be supported.

@ehmicky ehmicky force-pushed the node-option branch 2 times, most recently from 4bf0902 to 5532b2e Compare February 8, 2024 17:42
@ehmicky
Copy link
Collaborator Author

ehmicky commented Feb 8, 2024

Conflict fixed. 👍

@sindresorhus sindresorhus merged commit 663136b into main Feb 8, 2024
12 checks passed
@sindresorhus sindresorhus deleted the node-option branch February 8, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-using the features from execaNode()
2 participants