Commit e2fc175
committed
fix(tests): pass undefined env to avoid multiple process.env spreads
Root cause found: The spawn function from @socketsecurity/lib/spawn
ALWAYS spreads process.env first (line 622), then spreads our env:
env: {
__proto__: null,
...process.env, // spawn's spread
...env, // our env
}
When we passed env with spread process.env, it caused multiple spreads:
...process.env (spawn's)
...process.env (our first spread)
...process.env (constants.processEnv)
Each spread creates a plain object, losing Windows Proxy behavior.
Solution: Pass undefined for env when no custom vars needed. Spawn
function will use process.env directly (with VITEST=1 already set).1 parent 0b86233 commit e2fc175
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
269 | 277 | | |
270 | 278 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 279 | + | |
276 | 280 | | |
277 | 281 | | |
278 | 282 | | |
| |||
0 commit comments