• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2// Flags: --expose-internals
3const common = require('../common');
4const assert = require('assert');
5const { emitExperimentalWarning } = require('internal/util');
6
7// This test ensures that the emitExperimentalWarning in internal/util emits a
8// warning when passed an unsupported feature and that it simply returns
9// when passed the same feature multiple times.
10
11process.on('warning', common.mustCall((warning) => {
12  assert(/is an experimental feature/.test(warning.message));
13}, 2));
14
15emitExperimentalWarning('feature1');
16emitExperimentalWarning('feature1'); // should not warn
17emitExperimentalWarning('feature2');
18