Skip to content

Commit

Permalink
test: test validity of prefix in mkdtempSync
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
lucamaraschi authored and MylesBorins committed Apr 19, 2017
1 parent c65de59 commit f23377c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-mkdtemp-sync-prefix-check.js
Original file line number Diff line number Diff line change
@@ -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$/
);
});

0 comments on commit f23377c

Please sign in to comment.