Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 837ca76

Browse filesBrowse files
Trottaddaleax
authored andcommitted
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>
1 parent 65dfeeb commit 837ca76
Copy full SHA for 837ca76

File tree

Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-8
lines changed
Open diff view settings
Collapse file

‎test/pummel/test-fs-watch-non-recursive.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-fs-watch-non-recursive.js
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,13 @@ const path = require('path');
2525
const fs = require('fs');
2626

2727
const tmpdir = require('../common/tmpdir');
28+
tmpdir.refresh();
2829

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

33-
function cleanup() {
34-
try { fs.unlinkSync(filepath); } catch { }
35-
try { fs.rmdirSync(testsubdir); } catch { }
36-
}
37-
process.on('exit', cleanup);
38-
cleanup();
39-
40-
try { fs.mkdirSync(testsubdir, 0o700); } catch {}
34+
fs.mkdirSync(testsubdir, 0o700);
4135

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.