Skip to content

Commit 583423b

Browse files
committed
fix(e2e): disable Node.js binary forwarding in .env.test
Set SOCKET_CLI_DISABLE_NODE_FORWARDING=1 in .env.test to disable Node.js binary forwarding during tests. This ensures tests run against the local CLI implementation without forwarding to production binaries. Previously attempted to set this in package.json script, but environment variables must be set in .env files for dotenvx to load them correctly.
1 parent 2f6efab commit 583423b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/cli/.env.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ NODE_OPTIONS="--max-old-space-size=2048 --unhandled-rejections=warn"
33
VITEST=1
44
# Points to local @socketsecurity/cli JS dist so stub binary doesn't download from npm
55
SOCKET_CLI_JS_PATH="./dist/cli.js"
6+
# Disable Node.js binary forwarding for tests
7+
SOCKET_CLI_DISABLE_NODE_FORWARDING=1
68
# E2E test configuration
79
# Set to 1 to enable E2E tests (requires Socket API token)
810
# RUN_E2E_TESTS=1

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"prepare": "dotenvx -q run -f .env.local -- husky",
5656
"bs": "dotenvx -q run -f .env.local -- pnpm run build; pnpm exec socket --",
5757
"s": "dotenvx -q run -f .env.local -- pnpm exec socket --",
58-
"e2e-tests": "SOCKET_CLI_FORWARDING=0 dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
58+
"e2e-tests": "dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
5959
"e2e:js": "node scripts/e2e.mjs --js",
6060
"e2e:smol": "node scripts/e2e.mjs --smol",
6161
"e2e:sea": "node scripts/e2e.mjs --sea",

0 commit comments

Comments
 (0)