-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use tmpDir instead of fixturesDir
This test was using fixturesDir to create temp files to test. This patch replaces that with tmpDir and uses `assert` module to test. Also, this test has been moved to `parallel`, from `sequential` mode. PR-URL: #2583 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]>
- Loading branch information
1 parent
8936302
commit c56aa82
Showing
2 changed files
with
31 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
var dir = path.resolve(common.tmpDir); | ||
|
||
// Make sure that the tmp directory is clean | ||
common.refreshTmpDir(); | ||
|
||
// Make a long path. | ||
for (var i = 0; i < 50; i++) { | ||
dir = dir + '/1234567890'; | ||
try { | ||
fs.mkdirSync(dir, '0777'); | ||
} catch (e) { | ||
if (e.code !== 'EEXIST') { | ||
throw e; | ||
} | ||
} | ||
} | ||
|
||
// Test if file exists synchronously | ||
assert(common.fileExists(dir), 'Directory is not accessible'); | ||
|
||
// Test if file exists asynchronously | ||
fs.access(dir, function(err) { | ||
assert(!err, 'Directory is not accessible'); | ||
}); |
This file was deleted.
Oops, something went wrong.