★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/82dd321e91Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
test: refactor test-fs-watch-non-recursive
The test was duplicating some functionality in the `tmpdir` module.

PR-URL: #25386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed May 16, 2019
1 parent 82bc4ac commit 82dd321e91f820571745e7d06a3461ba3dc51162
Showing with 2 additions and 8 deletions.
  1. +2 −8 test/pummel/test-fs-watch-non-recursive.js
@@ -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() {

0 comments on commit 82dd321

Please sign in to comment.