MCPcopy Create free account
hub / github.com/sindresorhus/execa / testCwdNodePath

Function testCwdNodePath

test/methods/node.js:169–175  ·  view source on GitHub ↗
(t, execaMethod)

Source from the content-addressed store, hash-verified

167test.serial('The "nodePath" option is relative to "cwd" when used in the subprocess - "node" option sync', testSubprocessNodePathCwd, runWithNodeOptionSync);
168
169const testCwdNodePath = async (t, execaMethod) => {
170 const nodePath = await getNodePath();
171 const cwd = path.dirname(path.dirname(nodePath));
172 const relativeExecPath = path.relative(cwd, nodePath);
173 const {stdout} = await execaMethod('--version', [], {nodePath: relativeExecPath, cwd});
174 t.is(stdout, `v${TEST_NODE_VERSION}`);
175};
176
177test.serial('The "nodePath" option is relative to "cwd" - execaNode()', testCwdNodePath, execaNode);
178test.serial('The "nodePath" option is relative to "cwd" - "node" option', testCwdNodePath, runWithNodeOption);

Callers

nothing calls this directly

Calls 1

getNodePathFunction · 0.85

Tested by

no test coverage detected