add "test" namespace to node.config.json
What is the problem this feature will solve?
I was suggested a few times that a test namespace would be beneficial for the test runner. It could fix issues like https://github.com/nodejs/node/issues/51384
What is the feature you are proposing to solve the problem?
A test namespace with configurations for the test runner, for coverage, filtering etc... Still need to create a draft of what it could look like
What alternatives have you considered?
none
cc @nodejs/test_runner @cjihrig
For additional context:
#51384 is a fairly simple issue to fix from a technical standpoint - allow the test runner to read flags from process.argv instead of only reading from process.execArgv. However, I don't think that should ever be the default behavior because it is inconsistent with how every other Node.js flag is handled. I also don't think it makes sense to add a dedicated CLI flag for that behavior.
If the new config file was capable of setting options that do not correspond to CLI flags, I think this would be a good fit.
I also wonder if the config file can accept code and not just json values, for example for defining global test hooks, or global state & setup
I also wonder if the config file can accept code and not just json values, for example for defining global test hooks, or global state & setup
Its a json file so they have to be json properties but you can setup a hook pointing to a file like loaders
https://github.com/nodejs/node/pull/58073 ā here's a first "poc". I'm still working on this, and any kind of feedback is more than welcome! This is the first step... I'm also working on adding support for "kDisallowedInEnvvar" options.
Hi! I'm new to the project and would love to contribute. Could you please confirm if this issue only involves adding a new top-level test key to node.config.json, or are there additional files or changes involved? Just want to be sure I'm approaching it correctly.
Thanks!
Hey @viky-01, it's great that you want to contribute, and you're definitely welcome to work on this issue too :)
Just one thing: I'm already working on this, as mentioned in my previous comment, and Iād like to avoid having two people working on the same problem at the same time.
That said, you're more than welcome to contribute to this issue, and your input will be greatly appreciated! š
Resolved by https://github.com/nodejs/node/pull/58073