UNPKG

470 BJavaScriptView Raw
1var fs = require('../lib/fs');
2var assert = require('assert');
3
4/**
5 * Tests the recursive creation of a directory
6 */
7exports.testRecursiveMkdir = function() {
8 fs.mkdir('/tmp/example_dir/first/second/third/fourth/fifth', 0777, true, function (err) {
9 assert.isUndefined(err);
10 });
11}
12
13exports.testRecursiveSyncMkdir = function() {
14 try {
15 fs.mkdirSync('/tmp/example_sync/first/second/third/fourth/fifth', 0777, true);
16 } catch (e) {
17 console.log(e);
18 }
19}