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.

18 lines
462 B

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