node/test/parallel/test-process-assert.js
Daniel Bevenius 3ad7c1ae97 test: remove unused deprecation code
Currently there are two tests that specify a third argument, a
deprecation code string, when calling common.expectWarning. The
function only takes two arguments and this third argument is not used.

This commit removes the deprecation code.

PR-URL: https://github.com/nodejs/node/pull/19317
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-15 07:20:06 +01:00

25 lines
550 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
common.expectWarning(
'DeprecationWarning',
'process.assert() is deprecated. Please use the `assert` module instead.'
);
assert.strictEqual(process.assert(1, 'error'), undefined);
common.expectsError(() => {
process.assert(undefined, 'errorMessage');
}, {
code: 'ERR_ASSERTION',
type: Error,
message: 'errorMessage'
});
common.expectsError(() => {
process.assert(false);
}, {
code: 'ERR_ASSERTION',
type: Error,
message: 'assertion error'
});