Skip to content

Commit

Permalink
test: use tmpDir instead of fixturesDir
Browse files Browse the repository at this point in the history
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 <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
thefourtheye committed Aug 27, 2015
1 parent de88255 commit b11e256
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 46 deletions.
31 changes: 31 additions & 0 deletions test/parallel/test-regress-GH-3739.js
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');
});
46 changes: 0 additions & 46 deletions test/sequential/test-regress-GH-3739.js

This file was deleted.

0 comments on commit b11e256

Please sign in to comment.