diff options
Diffstat (limited to 'test/testModules/sharedTestCases.js')
-rw-r--r-- | test/testModules/sharedTestCases.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/testModules/sharedTestCases.js b/test/testModules/sharedTestCases.js index 76498bd..7048ba8 100644 --- a/test/testModules/sharedTestCases.js +++ b/test/testModules/sharedTestCases.js @@ -337,4 +337,17 @@ describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv + } }); + it("should be possible to mock and revert JSON.parse (see #40)", function () { + var moduleA = rewire("./moduleA.js"), + revert; + + revert = moduleA.__set__({ + JSON: { + parse: function () { return true; } + } + }); + + revert(); + }); + }); |