Sha256: 70e069e0c329204cb49b374fd727505a1fde0084fe990177bac7d86b3f49d5ad

Contents?: true

Size: 866 Bytes

Versions: 153

Compression:

Stored size: 866 Bytes

Contents

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

test('umask sync modes', function (t) {
    t.plan(4);
    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);
    } catch (err) {
        t.fail(err);
        return t.end();
    }

    exists(file, function (ex) {
        t.ok(ex, 'file created');
        fs.stat(file, function (err, stat) {
            t.ifError(err);
            t.equal(stat.mode & 0777, (0777 & (~process.umask())));
            t.ok(stat.isDirectory(), 'target not a directory');
        });
    });
});

Version data entries

153 entries across 137 versions & 7 rubygems

Version Path
dragonfly_puppeteer-0.1.0 node_modules/extract-zip/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.8 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.7 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.6 node_modules/bower/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.5.5 node_modules/bower/node_modules/mkdirp/test/umask_sync.js