diff options
Diffstat (limited to 'deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js')
-rw-r--r-- | deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js index dce785623e..b18f7eb27d 100644 --- a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js +++ b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js @@ -1,38 +1,38 @@ -var path = require("path") +var path = require('path') -var test = require("tap").test -var statSync = require("graceful-fs").statSync -var mkdtemp = require("tmp").dir -var mkdirp = require("mkdirp") +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') -var vacuum = require("../vacuum.js") +var vacuum = require('../vacuum.js') // CONSTANTS var TEMP_OPTIONS = { - unsafeCleanup : true, - mode : "0700" + unsafeCleanup: true, + mode: '0700' } -var SHORT_PATH = path.join("i", "am", "a", "path") -var REMOVE_PATH = path.join(SHORT_PATH, "of", "a", "certain", "length") -var OTHER_PATH = path.join(SHORT_PATH, "of", "no", "qualities") +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var REMOVE_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'length') +var OTHER_PATH = path.join(SHORT_PATH, 'of', 'no', 'qualities') var messages = [] -function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } var testBase, testPath, otherPath -test("xXx setup xXx", function (t) { +test('xXx setup xXx', function (t) { mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, "temp directory exists") + t.ifError(er, 'temp directory exists') - testBase = path.resolve(tmpdir, SHORT_PATH) - testPath = path.resolve(tmpdir, REMOVE_PATH) + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, REMOVE_PATH) otherPath = path.resolve(tmpdir, OTHER_PATH) mkdirp(testPath, function (er) { - t.ifError(er, "made test path") + t.ifError(er, 'made test path') mkdirp(otherPath, function (er) { - t.ifError(er, "made other path") + t.ifError(er, 'made other path') t.end() }) @@ -40,36 +40,36 @@ test("xXx setup xXx", function (t) { }) }) -test("remove up to a point", function (t) { - vacuum(testPath, {purge : false, base : testBase, log : log}, function (er) { - t.ifError(er, "cleaned up to base") +test('remove up to a point', function (t) { + vacuum(testPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') - t.equal(messages.length, 4, "got 3 removal & 1 finish message") + t.equal(messages.length, 4, 'got 3 removal & 1 finish message') t.equal( - messages[3], "quitting because other entries in " + testBase + "/of", - "got expected final message" + messages[3], 'quitting because other entries in ' + testBase + '/of', + 'got expected final message' ) var stat var verifyPath = testPath - function verify() { stat = statSync(verifyPath) } + function verify () { stat = statSync(verifyPath) } for (var i = 0; i < 3; i++) { - t.throws(verify, verifyPath + " cannot be statted") - t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') verifyPath = path.dirname(verifyPath) } t.doesNotThrow(function () { stat = statSync(otherPath) - }, otherPath + " can be statted") - t.ok(stat && stat.isDirectory(), otherPath + " is still a directory") + }, otherPath + ' can be statted') + t.ok(stat && stat.isDirectory(), otherPath + ' is still a directory') - var intersection = path.join(testBase, "of") + var intersection = path.join(testBase, 'of') t.doesNotThrow(function () { stat = statSync(intersection) - }, intersection + " can be statted") - t.ok(stat && stat.isDirectory(), intersection + " is still a directory") + }, intersection + ' can be statted') + t.ok(stat && stat.isDirectory(), intersection + ' is still a directory') t.end() }) |