Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'testLib/sharedTestCases.js')
-rw-r--r--testLib/sharedTestCases.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/testLib/sharedTestCases.js b/testLib/sharedTestCases.js
index 5230092..ec5e116 100644
--- a/testLib/sharedTestCases.js
+++ b/testLib/sharedTestCases.js
@@ -414,4 +414,9 @@ describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv +
expect(ES2015Module.getLang()).to.equal("nl");
})
+ it("Should have correct __filename and __dirname when mocked using convertConst", function() {
+ expect(rewire("./ES2015Module", { convertConst: true }).filename).to.equal(require("./ES2015Module").filename);
+ expect(rewire("./ES2015Module", { convertConst: true }).dirname).to.equal(require("./ES2015Module").dirname);
+ })
+
});