From 1a95eaf7febc6e5b151bde63c37dcfdcafcfc3df Mon Sep 17 00:00:00 2001 From: JP Richardson Date: Sat, 28 Mar 2015 06:01:23 -0500 Subject: [PATCH] test/mkdirp/umask.test: JSS --- test/mkdirp/umask.test.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/mkdirp/umask.test.js b/test/mkdirp/umask.test.js index 8bd227a..f3fc1f0 100644 --- a/test/mkdirp/umask.test.js +++ b/test/mkdirp/umask.test.js @@ -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) {