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 <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
lucamaraschi authored and MylesBorins committed Mar 28, 2017
1 parent 1c0435b commit 414df6c
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 414df6c

Please sign in to comment.