PageRenderTime 27ms CodeModel.GetById 21ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/node_modules/mkdirp/test/root.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 19 lines | 16 code | 2 blank | 1 comment | 2 complexity | 1d8aad344388793f4ba1a2b68fc1e130 MD5 | raw file
 1var mkdirp = require('../');
 2var path = require('path');
 3var fs = require('fs');
 4var test = require('tap').test;
 5var _0755 = parseInt('0755', 8);
 6
 7test('root', function (t) {
 8    // '/' on unix, 'c:/' on windows.
 9    var file = path.resolve('/');
10
11    mkdirp(file, _0755, function (err) {
12        if (err) throw err
13        fs.stat(file, function (er, stat) {
14            if (er) throw er
15            t.ok(stat.isDirectory(), 'target is a directory');
16            t.end();
17        })
18    });
19});