test: fix test-config-json-schema with --openssl-use-def-ca-store

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67200
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Antoine du Hamel authored and GitHub committed 2026-11-07 09:12:29 +00:00
1 parent a43bfb5bb2
commit d8e22bfdb2
1 file changed
+10 -1
+10 -1
View File
@@ -44,7 +44,16 @@ const assert = require('assert');
// 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()));
const schemaString = JSON.stringify(generateConfigJsonSchema());
const schema = JSON.parse(
schemaString.includes('"description":"use bundled CA store"') &&
schemaString.includes('"description":"use OpenSSL\'s default CA store (default)"') ?
// If node was built with --openssl-use-def-ca-store configure flag,
// it affects the values of `use-bundled-ca` and `use-openssl-ca`.
schemaString.replace('"use bundled CA store"', '"use bundled CA store (default)"')
.replace('"use OpenSSL\'s default CA store (default)"', '"use OpenSSL\'s default CA store"') :
schemaString
);
// 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