You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
496 B

7 years ago
  1. var mkdirp = require('../');
  2. var path = require('path');
  3. var fs = require('fs');
  4. var test = require('tap').test;
  5. var _0755 = parseInt('0755', 8);
  6. test('root', function (t) {
  7. // '/' on unix, 'c:/' on windows.
  8. var file = path.resolve('/');
  9. mkdirp(file, _0755, function (err) {
  10. if (err) throw err
  11. fs.stat(file, function (er, stat) {
  12. if (er) throw er
  13. t.ok(stat.isDirectory(), 'target is a directory');
  14. t.end();
  15. })
  16. });
  17. });