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