Commit 221b47d5566 for nodejs

commit 221b47d5566972f50eff146b2931f9e1dd0ef916
Author: Marco Ippolito <marcoippolito54@gmail.com>
Date:   Sun Oct 18 12:56:03 2026 +0200

    test: run test-config-json-schema in default builds

    The test was skipped unless Node.js was built with QUIC, but the JSON
    schema is generated from a build with the default configuration
    options, where QUIC is disabled. As a result the test never ran in CI
    and the schema was no longer checked.

    Skip the test instead when QUIC, DTLS or the V8 sandbox are enabled,
    or when FFI is disabled, since each of these changes the set of
    available options. Also remove the check for the `node_quic` variable,
    which no longer exists.

    Compare the schemas with assert.deepStrictEqual() so that a failure
    shows which options differ instead of two long strings.

    Assisted-by: claude:opus-5.5
    Signed-off-by: Marco Ippolito <marcoippolito54@gmail.com>
    PR-URL: https://github.com/nodejs/node/pull/66827
    Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

diff --git a/test/parallel/test-config-json-schema.js b/test/parallel/test-config-json-schema.js
index 08973bd17ee..ef05181b50b 100644
--- a/test/parallel/test-config-json-schema.js
+++ b/test/parallel/test-config-json-schema.js
@@ -21,15 +21,17 @@ if (!common.hasIntl) {
   common.skip('missing Intl');
 }

-if (!common.hasQuic) {
-  common.skip('this test requires QUIC');
-}
-
 if (process.config.variables.icu_small) {
   common.skip('this test assumes full ICU build');
 }

-if (process.config.variables.node_quic) {
+if (!common.hasFFI) {
+  common.skip('missing FFI');
+}
+
+// The JSON schema is generated from a build with the default configuration
+// options, where these are disabled and their options are not available.
+if (common.hasQuic || common.hasDtls || common.hasV8Sandbox) {
   common.skip('this test assumes default configuration options');
 }

@@ -39,7 +41,9 @@ const {
 const schemaInDoc = require('../../doc/node-config-schema.json');
 const assert = require('assert');

-const schema = generateConfigJsonSchema();
+// Round-trip through JSON so that the null-prototype objects returned by
+// generateConfigJsonSchema() show up as plain objects in the diff.
+const schema = JSON.parse(JSON.stringify(generateConfigJsonSchema()));

 // This assertion ensures that whenever we add a new env option, we also add it
 // to the JSON schema. The function getEnvOptionsInputType() returns all the available
@@ -48,5 +52,5 @@ const schema = generateConfigJsonSchema();
 // To regenerate the JSON schema, run:
 // out/Release/node --expose-internals tools/doc/generate-json-schema.mjs
 // And then run make doc to update the out/doc/node-config-schema.json file.
-assert.strictEqual(JSON.stringify(schema), JSON.stringify(schemaInDoc), 'JSON schema is outdated.' +
-  'Run `out/Release/node --expose-internals tools/doc/generate-json-schema.mjs` to update it.');
+assert.deepStrictEqual(schema, schemaInDoc, 'JSON schema is outdated. Run ' +
+  '`out/Release/node --expose-internals tools/doc/generate-json-schema.mjs` to update it.');