mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
test: test validity of prefix in mkdtempSync
This test is checking for the validity of the path used as parameter for mkdtempSync. PR-URL: https://github.com/nodejs/node/pull/12009 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
1 parent
c13dda1c43
commit
c2ead7e2a4
1 file changed
+13
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
|
||||
const assertValues = [undefined, null, 0, true, false, 1];
|
||||
|
||||
assertValues.forEach((assertValue) => {
|
||||
assert.throws(
|
||||
() => fs.mkdtempSync(assertValue, {}),
|
||||
/^TypeError: filename prefix is required$/
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user