Skip to content

Commit

Permalink
Merge branch 'vitest-node-env-production' into wjh/test-prod-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Mar 6, 2025
2 parents 3181bad + 31f230a commit a835eb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"copy-fork": "./scripts/tasks/unsafe-external-contributor-ci-workaround.sh",
"dev": "nx run-many --target=dev --all --parallel=999 --exclude=@lwc/perf-benchmarks,@lwc/perf-benchmarks-components,@lwc/integration-tests",
"test": "vitest --workspace vitest.workspace.mjs",
"test:production": "VITE_NODE_ENV=production vitest --workspace vitest.workspace.mjs",
"test:bespoke": "nx run-many --target=test",
"test:debug": "vitest --workspace vitest.workspace.mjs --inspect-brk --no-file-parallelism",
"test:ci": "vitest run --workspace vitest.workspace.mjs --coverage",
Expand Down
5 changes: 4 additions & 1 deletion vitest.shared.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import inspector from 'node:inspector';
import process from 'node:process';
import { defineConfig } from 'vitest/config';
import pkg from './package.json';

export default defineConfig({
test: {
env: {
NODE_ENV: process.env.VITE_NODE_ENV,
},
// Don't time out if we detect a debugger attached
testTimeout: inspector.url()
? // Largest allowed delay, see https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#maximum_delay_value
Expand Down

0 comments on commit a835eb1

Please sign in to comment.