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

Function testSubprocessNodePathCwd

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

Source from the content-addressed store, hash-verified

155});
156
157const testSubprocessNodePathCwd = async (t, execaMethod) => {
158 const nodePath = await getNodePath();
159 const cwd = path.dirname(path.dirname(nodePath));
160 const relativeExecPath = path.relative(cwd, nodePath);
161 const {stdout} = await execaMethod(...nodePathArguments, {nodePath: relativeExecPath, cwd});
162 t.true(stdout.includes(TEST_NODE_VERSION));
163};
164
165test.serial('The "nodePath" option is relative to "cwd" when used in the subprocess - execaNode()', testSubprocessNodePathCwd, execaNode);
166test.serial('The "nodePath" option is relative to "cwd" when used in the subprocess - "node" option', testSubprocessNodePathCwd, runWithNodeOption);

Callers

nothing calls this directly

Calls 1

getNodePathFunction · 0.85

Tested by

no test coverage detected