MCPcopy Create free account
hub / github.com/boost-ext/di / processModule

Function processModule

doc/cppcon-2018/reveal.js/test/qunit-2.5.0.js:2822–2859  ·  view source on GitHub ↗
(name, options, executeNow)

Source from the content-addressed store, hash-verified

2820 }
2821
2822 function processModule(name, options, executeNow) {
2823 var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2824
2825 var module = createModule(name, options, modifiers);
2826
2827 // Move any hooks to a 'hooks' object
2828 var testEnvironment = module.testEnvironment;
2829 var hooks = module.hooks = {};
2830
2831 setHookFromEnvironment(hooks, testEnvironment, "before");
2832 setHookFromEnvironment(hooks, testEnvironment, "beforeEach");
2833 setHookFromEnvironment(hooks, testEnvironment, "afterEach");
2834 setHookFromEnvironment(hooks, testEnvironment, "after");
2835
2836 function setHookFromEnvironment(hooks, environment, name) {
2837 var potentialHook = environment[name];
2838 hooks[name] = typeof potentialHook === "function" ? [potentialHook] : [];
2839 delete environment[name];
2840 }
2841
2842 var moduleFns = {
2843 before: setHookFunction(module, "before"),
2844 beforeEach: setHookFunction(module, "beforeEach"),
2845 afterEach: setHookFunction(module, "afterEach"),
2846 after: setHookFunction(module, "after")
2847 };
2848
2849 var currentModule = config.currentModule;
2850 if (objectType(executeNow) === "function") {
2851 moduleStack.push(module);
2852 config.currentModule = module;
2853 executeNow.call(module.testEnvironment, moduleFns);
2854 moduleStack.pop();
2855 module = module.parentModule || currentModule;
2856 }
2857
2858 config.currentModule = module;
2859 }
2860
2861 // TODO: extract this to a new file alongside its related functions
2862 function module$1(name, options, executeNow) {

Callers 2

module$1Function · 0.70
qunit-2.5.0.jsFile · 0.70

Calls 5

createModuleFunction · 0.70
setHookFromEnvironmentFunction · 0.70
setHookFunctionFunction · 0.70
objectTypeFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected