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

getLeakingSrc.test.js « test - github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc215eaafbc31fd79356071583b2f358eacc1838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict"; // run code in ES5 strict mode

var expect = require("expect.js"),
    getLeakingWrapper = require("../lib/getLeakingSrc.js");

describe("#getLeakingWrapper", function () {
    it("should return 'exports.__ = {};'", function () {
        expect(getLeakingWrapper([])).to.be("exports.__ = {};");
    });
    it("should return 'exports.__ = {somethingPrivate:somethingPrivate,somethingSecret:somethingSecret};'", function () {
        var leakArr = ["somethingPrivate", "somethingSecret"];

        expect(getLeakingWrapper(leakArr))
            .to.be("exports.__ = {somethingPrivate:somethingPrivate,somethingSecret:somethingSecret};");
    });
});