jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.82k stars 291 forks source link

node env is not take into debug mode #1106

Open sebbi08 opened 5 months ago

sebbi08 commented 5 months ago

Environment

  1. vscode-jest version: v6.1.1
  2. node -v: v20.10.0
  3. npm -v or yarn --version: 10.2.3
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected):
    ...@3.7.0
    ├─┬ ..../eslint-config-ts@1.6.6
    │ └─┬ eslint-plugin-jest@27.6.0
    │   └── jest@29.7.0 deduped
    ├─┬ ...@3.7.0 -> ./
    │ └── jest@29.7.0 deduped
    ├── jest@29.7.0
    └─┬ ts-jest@29.1.1
    └── jest@29.7.0 deduped
  5. your vscode-jest settings if customized:
  6. Operating system: ubuntu (WSL2)

Prerequisite

Steps to Reproduce

  1. set the setting

"jest.nodeEnv": { "MYENV": "TRUE" }

  1. use that property in a test

When running the test without debugging, it works and the env variable is set in the process. But when using the debugging, the env variable is empty.

connectdotz commented 5 months ago

That's true and I agree we should take care of this. Meanwhile, you can fix it with a custom debug config.