Skip to content

Commit

Permalink
Wokring around the issue in node 12
Browse files Browse the repository at this point in the history
  • Loading branch information
SparshithNR committed Jan 8, 2020
1 parent 6651ba9 commit c811935
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ describe("FSUpdater", () => {

it("must not be a symlink", () => {
fs.symlinkSync(".", "tmp/out");
// This is to work around the issue in node 12. Follow the issue
// https://github.com/nodejs/node/issues/31231
let err = false;
try {
fs.rmdirSync("tmp/out");
} catch (e) {
if (e && e.code == 'ENOTDIR') {
err = true;
}
}
if (!err) {
fs.symlinkSync(".", "tmp/out", "junction");
}
// End Workaround
expect(() => {
new FSUpdater("tmp/out");
}).to.throw();
Expand Down

0 comments on commit c811935

Please sign in to comment.