Skip to content

Commit 55ba1d4

Browse files
akailagibfahn
authored andcommitted
util: expand test coverage for util.deprecate
Test for invalid argument types passed to code on util.deprecate. PR-URL: #16305 Backport-PR-URL: #16430 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent a6b3cd8 commit 55ba1d4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const util = require('util');
5+
6+
[1, true, false, null, {}].forEach((notString) => {
7+
common.expectsError(() => util.deprecate(() => {}, 'message', notString), {
8+
type: TypeError,
9+
message: '`code` argument must be a string'
10+
});
11+
});

0 commit comments

Comments
 (0)