Skip to content

Commit 289ce5a

Browse files
committed
Added test to detect symlinked file change outside watched directory
1 parent 409ef51 commit 289ce5a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Watchpack.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,8 @@ describe("Watchpack", function() {
12371237
testHelper.symlinkFile(path.join("a", "b", "link"), "c");
12381238
testHelper.symlinkFile(path.join("a", "b", "link2"), "link");
12391239
testHelper.symlinkFile("link2", "link/link/link2");
1240+
testHelper.dir("b");
1241+
testHelper.symlinkDir(path.join("b", "link"), path.join("..", "a", "b"));
12401242

12411243
testHelper.tick(1000, done);
12421244
});
@@ -1368,6 +1370,20 @@ describe("Watchpack", function() {
13681370
}
13691371
);
13701372
});
1373+
1374+
it("should detect a change to symlinked file outside watched directory", function(done) {
1375+
expectWatchEvent(
1376+
[],
1377+
path.join(fixtures, "b"),
1378+
changes => {
1379+
Array.from(changes).should.be.eql([path.join(fixtures, "b")]);
1380+
done();
1381+
},
1382+
() => {
1383+
testHelper.file(path.join("a", "b", "d"));
1384+
}
1385+
);
1386+
});
13711387
});
13721388
} else {
13731389
it("symlinks");

0 commit comments

Comments
 (0)