This repository has been archived on 2026-03-31. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
wrench-js/tests/mkdirSyncRecursive.js
2011-10-23 15:48:43 +08:00

26 lines
659 B
JavaScript

var testCase = require('nodeunit').testCase;
var fs = require('fs');
var wrench = require('wrench');
var path = require('path');
module.exports = testCase({
testMkdirSyncRecursive: function(test) {
var dir = __dirname + '/_tmp/foo/bar';
test.equals(path.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?');
wrench.mkdirSyncRecursive(dir, 0777);
test.equals(path.existsSync(dir), true, 'Dir should exist now');
// clean up
while (dir != __dirname) {
fs.rmdirSync(dir);
dir = path.dirname(dir);
}
test.done();
},
});
// vim: et ts=4 sw=4