Skip to content

Commit

Permalink
test: GH-178 Unit tests for importing shebang modules
Browse files Browse the repository at this point in the history
  • Loading branch information
breautek committed Mar 31, 2020
1 parent 90e781f commit dea7b22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testLib/sharedTestCases.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,9 @@ module.exports = function () {
}).to.throwException(/^Assignment to constant variable at .+?wrongConstModule\.js:4:1$/);
});

it("should be possible to rewire shebang modules", function () {
expect(function () {
rewire("./shebangModule");
}).to.not.throwError();
});
};
7 changes: 7 additions & 0 deletions testLib/shebangModule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node

function shebangs() {
return true;
}

module.exports.shebangs = shebangs;

0 comments on commit dea7b22

Please sign in to comment.