blob: 06d3df7a73bd9a11c62cf9361dfbf39fecd4c627 [file] [edit]
'use strict';
// Flags: --expose-internals
const common = require('../common');
const assert = require('assert');
const { emitExperimentalWarning } = require('internal/util');
// This test ensures that the emitExperimentalWarning in internal/util emits a
// warning when passed an unsupported feature and that it simply returns
// when passed the same feature multiple times.
process.on('warning', common.mustCall((warning) => {
assert.match(warning.message, /is an experimental feature/);
}, 2));
emitExperimentalWarning('feature1');
emitExperimentalWarning('feature1'); // should not warn
emitExperimentalWarning('feature2');