Sha256: f4cb914105d13344dc304d733cebb515cec71d890778cfb62f0b533dc5d19e70

Contents?: true

Size: 889 Bytes

Versions: 242

Compression:

Stored size: 889 Bytes

Contents

var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;

test('sync', function (t) {
    t.plan(2);
    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);

    var file = '/tmp/' + [x,y,z].join('/');

    try {
        mkdirp.sync(file, 0755);
    } catch (err) {
        t.fail(err);
        return t.end();
    }

    path.exists(file, function (ex) {
        if (!ex) t.fail('file not created')
        else fs.stat(file, function (err, stat) {
            if (err) t.fail(err)
            else {
                t.equal(stat.mode & 0777, 0755);
                t.ok(stat.isDirectory(), 'target not a directory');
                t.end();
            }
        });
    });
});

Version data entries

242 entries across 205 versions & 11 rubygems

Version Path
ela-4.1.6 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.6 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.6 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.5 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.5 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.5 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.4 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.4 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.4 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.3 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.3 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.3 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.2 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.2 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.2 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.1 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/sync.js
ela-4.1.1 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.1 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js
ela-4.1.0 node_modules/poised/node_modules/mkdirp/test/sync.js
ela-4.1.0 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/sync.js