diff options
author | Luca Maraschi <luca.maraschi@gmail.com> | 2017-03-23 16:38:58 -0400 |
---|---|---|
committer | Franziska Hinkelmann <franzih@chromium.org> | 2017-03-26 11:42:07 +0200 |
commit | c2ead7e2a43553e49d764a8e9ee89bfdc7e210de (patch) | |
tree | 881b50e830b16630691c68c2632a4aac80dafa88 /test | |
parent | c13dda1c43a79d74c7aca085c42d2f19b8fd21b1 (diff) | |
download | android-node-v8-c2ead7e2a43553e49d764a8e9ee89bfdc7e210de.tar.gz android-node-v8-c2ead7e2a43553e49d764a8e9ee89bfdc7e210de.tar.bz2 android-node-v8-c2ead7e2a43553e49d764a8e9ee89bfdc7e210de.zip |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-mkdtemp-sync-prefix-check.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parallel/test-mkdtemp-sync-prefix-check.js b/test/parallel/test-mkdtemp-sync-prefix-check.js new file mode 100644 index 0000000000..825f622f06 --- /dev/null +++ b/test/parallel/test-mkdtemp-sync-prefix-check.js @@ -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$/ + ); +}); |