Skip to content

Commit 7b5b6fb

Browse files
committed
test: fix test-config-json-schema with --openssl-use-def-ca-store
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #67200 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 4cc7d1b commit 7b5b6fb

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎test/parallel/test-config-json-schema.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ const assert = require('assert');
4444

4545
// Round-trip through JSON so that the null-prototype objects returned by
4646
// generateConfigJsonSchema() show up as plain objects in the diff.
47-
const schema = JSON.parse(JSON.stringify(generateConfigJsonSchema()));
47+
const schemaString = JSON.stringify(generateConfigJsonSchema());
48+
const schema = JSON.parse(
49+
schemaString.includes('"description":"use bundled CA store"') &&
50+
schemaString.includes('"description":"use OpenSSL\'s default CA store (default)"') ?
51+
// If node was built with --openssl-use-def-ca-store configure flag,
52+
// it affects the values of `use-bundled-ca` and `use-openssl-ca`.
53+
schemaString.replace('"use bundled CA store"', '"use bundled CA store (default)"')
54+
.replace('"use OpenSSL\'s default CA store (default)"', '"use OpenSSL\'s default CA store"') :
55+
schemaString
56+
);
4857

4958
// This assertion ensures that whenever we add a new env option, we also add it
5059
// to the JSON schema. The function getEnvOptionsInputType() returns all the available

0 commit comments

Comments
 (0)