Skip to content

Commit 414df6c

Browse files
lucamaraschiMylesBorins
authored andcommitted
test: test validity of prefix in mkdtempSync
This test is checking for the validity of the path used as parameter for mkdtempSync. PR-URL: #12009 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 1c0435b commit 414df6c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
const fs = require('fs');
5+
6+
const assertValues = [undefined, null, 0, true, false, 1];
7+
8+
assertValues.forEach((assertValue) => {
9+
assert.throws(
10+
() => fs.mkdtempSync(assertValue, {}),
11+
/^TypeError: filename prefix is required$/
12+
);
13+
});

0 commit comments

Comments
 (0)