Skip to content
This repository was archived by the owner on Aug 31, 2018. It is now read-only.

Commit 6871554

Browse files
akailaaddaleax
authored andcommitted
util: expand test coverage for util.deprecate
Test for invalid argument types passed to code on util.deprecate. PR-URL: nodejs/node#16305 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 2ca46a1 commit 6871554

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
code: 'ERR_INVALID_ARG_TYPE',
9+
type: TypeError,
10+
message: 'The "code" argument must be of type string'
11+
});
12+
});

0 commit comments

Comments
 (0)