summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-deprecate-invalid-code.js
blob: 635bab4252fb5b6a0a1f7117a5e3ce2d3fe73781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';

const common = require('../common');
const util = require('util');

[1, true, false, null, {}].forEach((notString) => {
  common.expectsError(() => util.deprecate(() => {}, 'message', notString), {
    code: 'ERR_INVALID_ARG_TYPE',
    type: TypeError,
    message: 'The "code" argument must be of type string. ' +
             `Received type ${typeof notString}`
  });
});