Skip to content

Commit

Permalink
test: refactor test-fs-watch-non-recursive
Browse files Browse the repository at this point in the history
The test was duplicating some functionality in the `tmpdir` module.

PR-URL: #25386
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and addaleax committed Jan 14, 2019
1 parent 65dfeeb commit 837ca76
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/pummel/test-fs-watch-non-recursive.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,13 @@ const path = require('path');
const fs = require('fs');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

const testDir = tmpdir.path;
const testsubdir = path.join(testDir, 'testsubdir');
const filepath = path.join(testsubdir, 'watch.txt');

function cleanup() {
try { fs.unlinkSync(filepath); } catch { }
try { fs.rmdirSync(testsubdir); } catch { }
}
process.on('exit', cleanup);
cleanup();

try { fs.mkdirSync(testsubdir, 0o700); } catch {}
fs.mkdirSync(testsubdir, 0o700);

// Need a grace period, else the mkdirSync() above fires off an event.
setTimeout(function() {
Expand Down

0 comments on commit 837ca76

Please sign in to comment.