Closed matheuslanduci closed 3 weeks ago
My guess is that it has something to do with this line: https://github.com/mhassan1/redis-memory-server/blob/686899040c3080bb9e7bfa55b8a9b7541cbda34c/src/util/RedisInstance.ts#L220
I am looking into it.
I'm not able to replicate this locally. What command are you running to execute the tests?
Please add the following to the top of setup-tests.ts
and let me know the result:
console.log(process.env.NODE)
console.log(process.argv)
console.log(process.execPath)
I'm running the command pnpm test
that goes to vitest
This is the output of the logs:
# process.env.NODE
C:\Users\Matheus Landuci\AppData\Local\pnpm\pnpm.exe
# process.argv
[
'C:\\Program Files\\nodejs\\node.exe',
'E:\\Workspaces\\Projects\\Project\\node_modules\\.pnpm\\tinypool@1.0.1\\node_modules\\tinypool\\dist\\entry\\process.js'
]
# process.execPath
C:\Program Files\nodejs\node.exe
Using Node.js 22.3.0
If I try to run in a terminal (no VSCode running) it opens a new VSCode window with the file.
Things I tried:
Fixed it :)
Since the process.env.NODE
is different than the process.argv
, I put a NODE
env in my .env.test and the value is where my Node executable is that is 'C:\Program Files\nodejs\node.exe'
Thanks.
Glad you found a workaround. Out of curiosity, what versions of pnpm
and vitest
are you using?
Using pnpm 9.9.0
and vitest 2.1.3
The only way I can replicate this is by manually setting process.env.NODE = 'C:\\path\\to\\pnpm'
, but that should never be set to something other than a node
binary. If you can figure out where that is being set in your environment, that would be helpful. I can see where pnpm
sets it to process.execPath
(if it's not already set to something else): https://github.com/pnpm/npm-lifecycle/blob/1e0f149176877f906968a01087cf63290652ccbc/index.js#L81.
Hello,
I'm using
redis-memory-server
as an instance for my tests withvitest
on Windows 10, and every time a test runs (and the server is killed), a script called redis_killer.js opens in my VSCode.The tests run successfully; the only issue is that this file keeps opening.
I don't know if this could be related, but I'm using
turbo
and a monorepo setup.