Skip to content

Commit

Permalink
Added test to detect symlinked file change outside watched directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjhanToteck committed Mar 8, 2024
1 parent 409ef51 commit 289ce5a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/Watchpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,8 @@ describe("Watchpack", function() {
testHelper.symlinkFile(path.join("a", "b", "link"), "c");
testHelper.symlinkFile(path.join("a", "b", "link2"), "link");
testHelper.symlinkFile("link2", "link/link/link2");
testHelper.dir("b");
testHelper.symlinkDir(path.join("b", "link"), path.join("..", "a", "b"));

testHelper.tick(1000, done);
});
Expand Down Expand Up @@ -1368,6 +1370,20 @@ describe("Watchpack", function() {
}
);
});

it("should detect a change to symlinked file outside watched directory", function(done) {
expectWatchEvent(
[],
path.join(fixtures, "b"),
changes => {
Array.from(changes).should.be.eql([path.join(fixtures, "b")]);
done();
},
() => {
testHelper.file(path.join("a", "b", "d"));
}
);
});
});
} else {
it("symlinks");
Expand Down

0 comments on commit 289ce5a

Please sign in to comment.