From 20c2e5354e385568e8de33d02b339fe43e3f5ef6 Mon Sep 17 00:00:00 2001 From: Alex Plischke Date: Thu, 1 Aug 2024 14:44:52 -0700 Subject: [PATCH 1/2] deps: bump sauce-testrunner-utils@3.1.0 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fcb29488..3f912f51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,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", @@ -14265,9 +14265,9 @@ } }, "node_modules/sauce-testrunner-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/sauce-testrunner-utils/-/sauce-testrunner-utils-3.0.0.tgz", - "integrity": "sha512-0W7UuxJ/kOHlDdvFNUnv/HMIp9N8jNHVELkTxwDMZuEXP7EvRSkskaEblmqwCgU/3UxpjgpRxuhxKEj+mbOArA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/sauce-testrunner-utils/-/sauce-testrunner-utils-3.1.0.tgz", + "integrity": "sha512-jaDK1XxIq8A3peFjxkR6kXkQrmsa7SeVw5h/+qcpFX2PUvuXNv06PabqXvhD3JAG1SAqC6t6DIb/3Djz3OmLDQ==", "dependencies": { "lodash": "^4.17.21", "npm": "^10.8.1", diff --git a/package.json b/package.json index 986df905..d326f786 100644 --- a/package.json +++ b/package.json @@ -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", From 4ec6dc897341ecb9dcb007e86bd3cdff702dd149 Mon Sep 17 00:00:00 2001 From: Alex Plischke Date: Thu, 1 Aug 2024 14:46:28 -0700 Subject: [PATCH 2/2] feat: enable use of global node context --- src/testcafe-runner.ts | 7 ++++++- src/type.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/testcafe-runner.ts b/src/testcafe-runner.ts index da905bd5..1d112aee 100644 --- a/src/testcafe-runner.ts +++ b/src/testcafe-runner.ts @@ -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, @@ -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); diff --git a/src/type.ts b/src/type.ts index 17112dea..3195a99e 100644 --- a/src/type.ts +++ b/src/type.ts @@ -104,6 +104,7 @@ export type TestCafeConfig = { version: string; configFile?: string; }; + nodeVersion?: string; artifacts?: Artifacts; };