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

moduleA.js « A « testModules « test - github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ffa329036939320891a7953420d1f83859579965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict"; // run code in ES5 strict mode

var path = require("path"),

    // different ways to require a module
    fs = require("fs"),     // native module
    c = require("../C/moduleC.js"),     // relative path
    b = require(path.resolve(__dirname, "../B/moduleB.js")),    // absolute path
    toSrc = require("toSrc"),   // node_modules path
    index = require("../");     // index.js path

var myPrivateVar = "Hello I'm very private";

function myPrivateFunction() {
    return "Hello I'm very private";
}

function exportAll() {
    // expose all required modules to test for mocks
    exports.fs = fs;
    exports.b = b;
    exports.c = c;
    exports.toSrc = toSrc;
    exports.index = index;
    exports.process = process;
    exports.console = console;
}

exportAll();
exports.exportAll = exportAll;