Skip to content

Commit ebca753

Browse files
committed
Fix global leak in watch tests
1 parent 548f45c commit ebca753

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

test/nodes/core/io/23-watch_spec.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,15 @@ describe('watch Node', function() {
2929
var count = 0;
3030

3131
function prepareDir() {
32-
dirToWatch = path.join(baseDir, "base"+count);
33-
file0ToWatch = path.join(dirToWatch, "file0.txt");
34-
file1ToWatch = path.join(dirToWatch, "file1.txt");
35-
subDirToWatch = path.join(dirToWatch, "subdir");
36-
file2ToWatch = path.join(subDirToWatch, "file2.txt");
32+
var dirToWatch = path.join(baseDir, "base"+count);
3733
fs.mkdirSync(dirToWatch);
3834
count++;
3935
return {
4036
dirToWatch:dirToWatch,
41-
file0ToWatch:file0ToWatch,
42-
file1ToWatch:file1ToWatch,
43-
subDirToWatch:subDirToWatch,
44-
file2ToWatch:file2ToWatch
37+
file0ToWatch:path.join(dirToWatch, "file0.txt");,
38+
file1ToWatch:path.join(dirToWatch, "file1.txt");,
39+
subDirToWatch:path.join(dirToWatch, "subdir");,
40+
file2ToWatch:path.join(subDirToWatch, "file2.txt");
4541
}
4642
}
4743

0 commit comments

Comments
 (0)