How to pass custom CLI arguments to my globalSetup script? #6593
-
Inside of my global setup file, I am starting Puppeteer browser to do E2E testing (I will migrate to Vitest Browser Mode in the future, but not ready yet). I would like to add a CLI option to Vitest like However, if I do so, Vitest will complain about unknown CLI options: "Unknown option Options considered:
Are there better options available that I am not aware of? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There were similar requests (the one I remember is on Vite vitejs/vite#16251), but personally it feels unusual to support such custom argument for tools like Vite and Vitest, so probably it's not going forward. I would imagine your 3rd option (env var) isn't too bad. For pnpm (and probably yarn?), shell emulator provides a uniform env var support https://pnpm.io/cli/run#shell-emulator |
Beta Was this translation helpful? Give feedback.
There were similar requests (the one I remember is on Vite vitejs/vite#16251), but personally it feels unusual to support such custom argument for tools like Vite and Vitest, so probably it's not going forward.
I would imagine your 3rd option (env var) isn't too bad. For pnpm (and probably yarn?), shell emulator provides a uniform env var support https://pnpm.io/cli/run#shell-emulator