node/test/parallel/test-warn-sigprof.js
Ruben Bridgewater baa4b9b425
test: refactor common.expectWarning()
The current API is somewhat confusing at times and simpler usage is
possible. This overloads the arguments further to accept objects
with deprecation codes as property keys. It also adds documentation
for the different possible styles.

Besides that it is now going to validate for the code being present
in case of deprecations but not for other cases. The former validation
was not consistent as it only validated some cases and accepted
undefined instead of `common.noWarnCode`. This check is removed due to
the lack of consistency. `common.noWarnCode` is completely removed
due to just being sugar for `undefined`.

This also verifies that the warning order is identical to the order
in which they are triggered.

PR-URL: https://github.com/nodejs/node/pull/25251
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-10 03:22:12 +01:00

19 lines
516 B
JavaScript

// Flags: --inspect=0
'use strict';
const common = require('../common');
// The inspector attempts to start when Node starts. Once started, the inspector
// warns on the use of a SIGPROF listener.
common.skipIfInspectorDisabled();
if (common.isWindows)
common.skip('test does not apply to Windows');
common.skipIfWorker(); // Worker inspector never has a server running
common.expectWarning('Warning',
'process.on(SIGPROF) is reserved while debugging');
process.on('SIGPROF', () => {});