We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e059bc5 commit 373d5dfCopy full SHA for 373d5df
test/parallel/test-util-emit-experimental-warning.js
@@ -0,0 +1,17 @@
1
+'use strict';
2
+// Flags: --expose-internals
3
+const common = require('../common');
4
+const assert = require('assert');
5
+const { 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
11
+process.on('warning', common.mustCall((warning) => {
12
+ assert(/is an experimental feature/.test(warning.message));
13
+}, 2));
14
15
+emitExperimentalWarning('feature1');
16
+emitExperimentalWarning('feature1'); // should not warn
17
+emitExperimentalWarning('feature2');
0 commit comments