Skip to content

Commit 8b769cf

Browse files
marco-ippolitonodejs-github-bot
authored andcommitted
src: rename config file testRunner to test
PR-URL: #60798 Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent 46dc5d7 commit 8b769cf

17 files changed

+58
-29
lines changed

β€Ždoc/api/cli.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ in the `$schema` must be replaced with the version of Node.js you are using.
10161016
"watch-path": "src",
10171017
"watch-preserve-output": true
10181018
},
1019-
"testRunner": {
1019+
"test": {
10201020
"test-isolation": "process"
10211021
},
10221022
"watch": {
@@ -1029,7 +1029,7 @@ The configuration file supports namespace-specific options:
10291029

10301030
* The `nodeOptions` field contains CLI flags that are allowed in [`NODE_OPTIONS`][].
10311031

1032-
* Namespace fields like `testRunner` contain configuration specific to that subsystem.
1032+
* Namespace fields like `test` contain configuration specific to that subsystem.
10331033

10341034
No-op flags are not supported.
10351035
Not all V8 flags are currently supported.

β€Ždoc/node-config-schema.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@
655655
}
656656
}
657657
},
658-
"testRunner": {
658+
"test": {
659659
"type": "object",
660660
"additionalProperties": false,
661661
"properties": {

β€Žsrc/node_config_file.ccβ€Ž

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,20 @@ ParseResult ConfigReader::ParseConfig(const std::string_view& config_path) {
262262
return ParseResult::InvalidContent;
263263
}
264264

265-
// Check if this field is a valid namespace
266265
std::string namespace_name(field_name);
266+
267+
// TODO(@marco-ippolito): Remove warning for testRunner namespace
268+
if (namespace_name == "testRunner") {
269+
FPrintF(stderr,
270+
"the \"testRunner\" namespace has been removed. "
271+
"Use \"test\" instead.\n");
272+
// Better to throw an error than to ignore it
273+
// Otherwise users might think their test suite is green
274+
// when it's not running
275+
return ParseResult::InvalidContent;
276+
}
277+
278+
// Check if this field is a valid namespace
267279
if (!valid_namespaces.contains(namespace_name)) {
268280
// If not, skip it
269281
continue;

β€Žsrc/node_options.hβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ std::vector<std::string> MapAvailableNamespaces();
415415
// Define all namespace entries
416416
#define OPTION_NAMESPACE_LIST(V) \
417417
V(kNoNamespace, "") \
418-
V(kTestRunnerNamespace, "testRunner") \
418+
V(kTestRunnerNamespace, "test") \
419419
V(kWatchNamespace, "watch") \
420420
V(kPermissionNamespace, "permission")
421421

β€Žtest/fixtures/options-as-flags/test-config.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"experimental-transform-types": true,
44
"max-http-header-size": 8192
55
},
6-
"testRunner": {
6+
"test": {
77
"test-isolation": "none"
88
}
99
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"testRunner": {
3+
"test-isolation": "none"
4+
}
5+
}

β€Žtest/fixtures/rc/duplicate-namespace-option/node.config.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-name-pattern": "first-pattern",
44
"test-name-pattern": "second-pattern"
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"testRunner": {}
2+
"test": {}
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-coverage-exclude": ["config-pattern1", "config-pattern2"]
44
}
55
}

β€Žtest/fixtures/rc/namespace-with-disallowed-envvar.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"testRunner": {
2+
"test": {
33
"test-concurrency": 1,
44
"experimental-test-coverage": true
55
}

0 commit comments

Comments
Β (0)