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
ela-4.1.6 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.6 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.6 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.5 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.5 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.5 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.4 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.4 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.4 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.3 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.3 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.3 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.2 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.2 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.2 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.1 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.1 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
ela-4.1.1 node_modules/codo/node_modules/nib/node_modules/mkdirp/test/umask_sync.js
ela-4.1.0 node_modules/poised/node_modules/mkdirp/test/umask_sync.js
ela-4.1.0 node_modules/codo/node_modules/stylus/node_modules/mkdirp/test/umask_sync.js