mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
598 B
32 lines
598 B
'use strict';
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
|
|
const prefixValues = [undefined, null, 0, true, false, 1, ''];
|
|
|
|
function fail(value) {
|
|
common.expectsError(
|
|
() => {
|
|
fs.mkdtempSync(value, {});
|
|
},
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError
|
|
});
|
|
}
|
|
|
|
function failAsync(value) {
|
|
common.expectsError(
|
|
() => {
|
|
fs.mkdtemp(value, common.mustNotCall());
|
|
},
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError
|
|
});
|
|
}
|
|
|
|
prefixValues.forEach((prefixValue) => {
|
|
fail(prefixValue);
|
|
failAsync(prefixValue);
|
|
});
|
|
|