Skip to content

Commit

Permalink
test: testing 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
  • Loading branch information
lucamaraschi committed Mar 24, 2017
1 parent cfc8422 commit 6da040b
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 6da040b

Please sign in to comment.