#!/usr/bin/env node // scripts/require-perf-test-env.mjs // Enforces that perf test environment variables are set before running vitest. import { exit } from 'node:process' const errors = [] if (process.env.RUN_PERF_TESTS !== '1') { errors.push('RUN_PERF_TESTS=1 is required to run perf tests.') } if (!process.env.PLAYWRIGHT_CHROMIUM_BIN) { errors.push('PLAYWRIGHT_CHROMIUM_BIN must point to a Chromium executable.') } if (errors.length > 0) { console.error('\n Perf test environment not configured:\n') for (const err of errors) { console.error(` - ${err}`) } console.error('\n Usage:') console.error(' RUN_PERF_TESTS=1 \\') console.error(' PLAYWRIGHT_CHROMIUM_BIN=$(command -v chromium) \\') console.error(' bun run test:perf\n') exit(1) }