Sha256: ad3782e1d6c357d79aeb22b645c9cfd2ae7737ebd47ba574510177289b7dacf9

Contents?: true

Size: 918 Bytes

Versions: 237

Compression:

Stored size: 918 Bytes

Contents

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

test('umask sync modes', 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);
    } 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, (0777 & (~process.umask())));
                t.ok(stat.isDirectory(), 'target not a directory');
                t.end();
            }
        });
    });
});

Version data entries

237 entries across 200 versions & 11 rubygems

Version Path
trusty-festivity-extension-2.4.2 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.4.1 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.4.0 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.30 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.22 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.21 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.20 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.19 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.18 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.17 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.16 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.15 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js
trusty-festivity-extension-2.3.14 node_modules/bower/node_modules/bower-registry-client/node_modules/mkdirp/test/umask_sync.js