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: b1e137b0aad490a042e6fa641d58e0af2b8bc572 (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 'module.exports.__ = {};'", function () {
        expect(getLeakingWrapper([])).to.be("module.exports.__ = {};");
    });
    it("should return 'module.exports.__ = {somethingPrivate:somethingPrivate,somethingSecret:somethingSecret};'", function () {
        var leakArr = ["somethingPrivate", "somethingSecret"];

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