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:
authorJohannes <johannes.ewald@roomieplanet.de>2012-07-02 19:58:09 +0400
committerJohannes <johannes.ewald@roomieplanet.de>2012-07-02 19:58:09 +0400
commit8bfdd979dabc1a0ab2e85fd80548d66bccdd1b82 (patch)
treee0f246aaa958e135af053276b3a75c817e710fb1 /test/getImportGlobalsSrc.test.js
parent7d7eca0fbcecf677479b58ef8b84131cf656fd6d (diff)
- changed browserify version to 1.13.5
- fixed global var injection in the browser
Diffstat (limited to 'test/getImportGlobalsSrc.test.js')
-rw-r--r--test/getImportGlobalsSrc.test.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/getImportGlobalsSrc.test.js b/test/getImportGlobalsSrc.test.js
index 065bd59..0d9b020 100644
--- a/test/getImportGlobalsSrc.test.js
+++ b/test/getImportGlobalsSrc.test.js
@@ -19,4 +19,24 @@ describe("getImportGlobalsSrc", function () {
expect(actualGlobals).to.eql(expectedGlobals);
expect(actualGlobals.length).to.be.above(1);
});
+ it("should ignore the given variables", function () {
+ var context = {
+ global: global
+ },
+ ignore = ["console", "setTimeout"],
+ src,
+ actualGlobals,
+ expectedGlobals = Object.keys(global);
+
+ src = getImportGlobalsSrc(ignore);
+ expectedGlobals = expectedGlobals.filter(function filterIgnoredVars(value) {
+ return ignore.indexOf(value) === -1;
+ });
+ vm.runInNewContext(src, context);
+ actualGlobals = Object.keys(context);
+ actualGlobals.sort();
+ expectedGlobals.sort();
+ expect(actualGlobals).to.eql(expectedGlobals);
+ expect(actualGlobals.length).to.be.above(1);
+ });
}); \ No newline at end of file