Skip to content

Commit 62ece48

Browse files
author
Alex Plischke
authored
feat: enable use of global node context (#237)
1 parent 477418e commit 62ece48

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dotenv": "16.4.5",
2626
"lodash": "4.17.21",
2727
"mocha-junit-reporter": "^2.2.1",
28-
"sauce-testrunner-utils": "3.0.0",
28+
"sauce-testrunner-utils": "3.1.0",
2929
"shelljs": "^0.8.5",
3030
"testcafe": "3.6.2",
3131
"testcafe-browser-provider-ios": "0.5.0",

src/testcafe-runner.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { TestCafeConfig, Suite, CompilerOptions, second } from './type';
1717
import { generateJUnitFile } from './sauce-testreporter';
1818
import { setupProxy, isProxyAvailable } from './network-proxy';
19+
import { NodeContext } from 'sauce-testrunner-utils/lib/types';
1920

2021
async function prepareConfiguration(
2122
nodeBin: string,
@@ -65,7 +66,11 @@ async function prepareConfiguration(
6566
'bin',
6667
'npm-cli.js',
6768
);
68-
const nodeCtx = { nodePath: nodeBin, npmPath: npmBin };
69+
const nodeCtx: NodeContext = {
70+
nodePath: nodeBin,
71+
npmPath: npmBin,
72+
useGlobals: !!runCfg.nodeVersion,
73+
};
6974

7075
// Install NPM dependencies
7176
await prepareNpmEnv(runCfg, nodeCtx);

src/type.ts

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export type TestCafeConfig = {
104104
version: string;
105105
configFile?: string;
106106
};
107+
nodeVersion?: string;
107108
artifacts?: Artifacts;
108109
};
109110

0 commit comments

Comments
 (0)