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

feat: enable use of global node context #237

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dotenv": "16.4.5",
"lodash": "4.17.21",
"mocha-junit-reporter": "^2.2.1",
"sauce-testrunner-utils": "3.0.0",
"sauce-testrunner-utils": "3.1.0",
"shelljs": "^0.8.5",
"testcafe": "3.6.2",
"testcafe-browser-provider-ios": "0.5.0",
Expand Down
7 changes: 6 additions & 1 deletion src/testcafe-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { TestCafeConfig, Suite, CompilerOptions, second } from './type';
import { generateJUnitFile } from './sauce-testreporter';
import { setupProxy, isProxyAvailable } from './network-proxy';
import { NodeContext } from 'sauce-testrunner-utils/lib/types';

async function prepareConfiguration(
nodeBin: string,
Expand Down Expand Up @@ -65,7 +66,11 @@ async function prepareConfiguration(
'bin',
'npm-cli.js',
);
const nodeCtx = { nodePath: nodeBin, npmPath: npmBin };
const nodeCtx: NodeContext = {
nodePath: nodeBin,
npmPath: npmBin,
useGlobals: !!runCfg.nodeVersion,
};

// Install NPM dependencies
await prepareNpmEnv(runCfg, nodeCtx);
Expand Down
1 change: 1 addition & 0 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
configPath?: string;
customCompilerModulePath?: string;
options?: {
[key: string]: any;

Check warning on line 29 in src/type.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
};
};

Expand Down Expand Up @@ -104,6 +104,7 @@
version: string;
configFile?: string;
};
nodeVersion?: string;
artifacts?: Artifacts;
};

Expand Down
Loading