mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 23:52:40 +00:00

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>
25 lines
550 B
JavaScript
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'
|
|
});
|