2024-08-27 13:46:11 +02:00
|
|
|
// Flags: --no-warnings --expose-internals
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
|
|
|
|
if (!common.hasCrypto) {
|
|
|
|
common.skip('missing crypto');
|
|
|
|
}
|
|
|
|
|
|
|
|
const { hasOpenSSL3 } = require('../common/crypto');
|
|
|
|
|
|
|
|
if (!hasOpenSSL3) {
|
|
|
|
common.skip('this test requires OpenSSL 3.x');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!common.hasIntl) {
|
|
|
|
// A handful of the tests fail when ICU is not included.
|
|
|
|
common.skip('missing Intl');
|
|
|
|
}
|
|
|
|
|
2025-02-27 17:42:48 +00:00
|
|
|
if (process.config.variables.node_quic) {
|
|
|
|
common.skip('this test assumes default configuration options');
|
|
|
|
}
|
|
|
|
|
2024-08-27 13:46:11 +02:00
|
|
|
const {
|
|
|
|
generateConfigJsonSchema,
|
|
|
|
} = require('internal/options');
|
2025-02-27 16:02:10 -05:00
|
|
|
const schemaInDoc = require('../../doc/node-config-schema.json');
|
2024-08-27 13:46:11 +02:00
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
const schema = 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
|
|
|
|
// env options, so we can generate the JSON schema from it and compare it to the
|
|
|
|
// current JSON schema.
|
|
|
|
// To regenerate the JSON schema, run:
|
|
|
|
// out/Release/node --expose-internals tools/doc/generate-json-schema.mjs
|
2025-02-27 16:02:10 -05:00
|
|
|
// And then run make doc to update the out/doc/node-config-schema.json file.
|
2024-08-27 13:46:11 +02:00
|
|
|
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.');
|