connor4312 / connor4312/nodejs-testing
The `--test-global-setup` flag is silently ignored
- Dominant language
- TypeScript
- Stars
- 67
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
I use global [global setup and teardown](https://nodejs.org/docs/latest-v24.x/api/test.html#global-setup-and-teardown) in my tests to load environment variables from multiple files like so:
```shell
node --test --test-global-setup ./test/setup.ts ./test/app.test.ts
```
However I'm not able to set this flag in this extension.
It's silently ignored, even when passing invalid path (in that case native Node.js test runner throws `Error [ERR_MODULE_NOT_FOUND]`).
I've tried:
```jsonc
{
"nodejs-testing.nodejsParameters": [
// None of these work
"--test-global-setup", "${workspaceFolder}/test/setup.ts",
"--test-global-setup=${workspaceFolder}/test/setup.ts"
"--test-global-setup ${workspaceFolder}/test/setup.ts"
],
}
```
and
```jsonc
{
"nodejs-testing.extensions": [
{
"extensions": ["test.ts"],
"parameters": [
// None of these work
"--test-global-setup", "./test/setup.ts",
"--test-global-setup=./test/setup.ts",
"--test-global-setup ./test/setup.ts"
]
}
]
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.