chore: remove cross-env, move env vars to vitest config#4684
Merged
Conversation
1 task
9c07126 to
2799909
Compare
cross-env is archived (Nov 2025). Move HOME, LANG, and NO_COLOR env vars into vitest.config.ts instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c455cc2 to
fc785d5
Compare
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the archived cross-env dependency and moves the test-time environment variable setup into Vitest configuration so tests run with consistent HOME, LANG, and NO_COLOR without relying on shell-specific env var syntax.
Changes:
- Drop
cross-envfromdevDependenciesand simplify the roottestscript to run Vitest directly. - Configure
test.envinvitest.config.tsto injectHOME,LANG, andNO_COLORduring test runs. - Prune
yarn.lockaccordingly.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Removes cross-env usage/dependency and simplifies yarn test. |
| vitest.config.ts | Adds test.env values to replace prior cross-env-provided environment variables. |
| yarn.lock | Removes cross-env lock entry and updates related resolution entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cross-envwas archived by Kent C. Dodds in November 2025, and theproject recommends migrating to native solutions where possible. This
repo only used it in one place — the root
testscript — to setHOME,LANG, andNO_COLORfor the vitest run.Changes
package.jsoncross-env ^7.0.3fromdevDependencies.testscript:cross-env HOME=$PWD LANG=en_US.UTF-8 NO_COLOR=1 vitest run --coverage→vitest run --coverage.vitest.config.tstest.env: { HOME: process.cwd(), LANG: "en_US.UTF-8", NO_COLOR: "1" }.yarn.lockEquivalence
Vitest's
test.envinjects values intoprocess.envfor the testrun, matching the previous behaviour:
cross-env)vitest env)HOME$PWD(shell-evaluated at run time)process.cwd()(resolved at config load)LANGen_US.UTF-8en_US.UTF-8NO_COLOR1"1"HOMEis the only nuance:$PWDandprocess.cwd()resolve to thesame value when
yarn testis invoked from the repo root (as italways is in CI and the only documented workflow), so behaviour is
unchanged.