Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: refactor test-fs-watch-non-recursive
The test was duplicating some functionality in the `tmpdir` module.
  • Loading branch information
Trott committed Jan 8, 2019
commit bcd34ac1361590c8304feda7bc802a27ee6c435a
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