mirror of
https://github.com/jprichardson/node-fs-extra.git
synced 2026-01-25 16:42:57 +00:00
test/mkdirp/umask.test: JSS
This commit is contained in:
parent
7360865e8a
commit
1a95eaf7fe
@ -4,15 +4,15 @@ var path = require('path')
|
||||
var testutil = require('../_lib/util')
|
||||
var fse = require('../../')
|
||||
|
||||
'use strict'
|
||||
/* global afterEach, beforeEach, describe, it */
|
||||
|
||||
var TEST_DIR = ''
|
||||
var oct777 = parseInt('777', 8)
|
||||
|
||||
describe('mkdirp', function() {
|
||||
describe('mkdirp', function () {
|
||||
var _rndDir
|
||||
|
||||
beforeEach(function() {
|
||||
beforeEach(function () {
|
||||
TEST_DIR = testutil.createTestDir()
|
||||
TEST_DIR = path.join(TEST_DIR, 'mkdirp')
|
||||
|
||||
@ -21,22 +21,23 @@ describe('mkdirp', function() {
|
||||
fs.mkdirSync(TEST_DIR)
|
||||
|
||||
// for actual tests
|
||||
var x = Math.floor(Math.random() * Math.pow(16,6)).toString(16)
|
||||
var y = Math.floor(Math.random() * Math.pow(16,6)).toString(16)
|
||||
var z = Math.floor(Math.random() * Math.pow(16,6)).toString(16)
|
||||
var x = Math.floor(Math.random() * Math.pow(16, 6)).toString(16)
|
||||
var y = Math.floor(Math.random() * Math.pow(16, 6)).toString(16)
|
||||
var z = Math.floor(Math.random() * Math.pow(16, 6)).toString(16)
|
||||
|
||||
_rndDir = path.join(TEST_DIR, [x, y, z].join(path.sep))
|
||||
|
||||
// just to be safe, although unnecessary
|
||||
assert(!fs.existsSync(_rndDir))
|
||||
})
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
fse.removeSync(TEST_DIR)
|
||||
})
|
||||
|
||||
describe('umask', function() {
|
||||
describe('async', function() {
|
||||
it('should have proper umask', function(done) {
|
||||
describe('umask', function () {
|
||||
describe('async', function () {
|
||||
it('should have proper umask', function (done) {
|
||||
fse.mkdirp(_rndDir, function (err) {
|
||||
assert.ifError(err)
|
||||
fs.exists(_rndDir, function (ex) {
|
||||
@ -52,8 +53,8 @@ describe('mkdirp', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('sync', function() {
|
||||
it('should have proper umask', function(done) {
|
||||
describe('sync', function () {
|
||||
it('should have proper umask', function (done) {
|
||||
try {
|
||||
fse.mkdirpSync(_rndDir)
|
||||
} catch (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user