MCPcopy
hub / github.com/Mottie/Keyboard / processModule

Function processModule

testing/qunit-2.9.2.js:1161–1209  ·  view source on GitHub ↗
(name, options, executeNow)

Source from the content-addressed store, hash-verified

1159 }
1160
1161 function processModule(name, options, executeNow) {
1162 var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1163
1164 if (objectType(options) === "function") {
1165 executeNow = options;
1166 options = undefined;
1167 }
1168
1169 var module = createModule(name, options, modifiers);
1170
1171 // Move any hooks to a 'hooks' object
1172 var testEnvironment = module.testEnvironment;
1173 var hooks = module.hooks = {};
1174
1175 setHookFromEnvironment(hooks, testEnvironment, "before");
1176 setHookFromEnvironment(hooks, testEnvironment, "beforeEach");
1177 setHookFromEnvironment(hooks, testEnvironment, "afterEach");
1178 setHookFromEnvironment(hooks, testEnvironment, "after");
1179
1180 var moduleFns = {
1181 before: setHookFunction(module, "before"),
1182 beforeEach: setHookFunction(module, "beforeEach"),
1183 afterEach: setHookFunction(module, "afterEach"),
1184 after: setHookFunction(module, "after")
1185 };
1186
1187 var currentModule = config.currentModule;
1188 if (objectType(executeNow) === "function") {
1189 moduleStack.push(module);
1190 config.currentModule = module;
1191 executeNow.call(module.testEnvironment, moduleFns);
1192 moduleStack.pop();
1193 module = module.parentModule || currentModule;
1194 }
1195
1196 config.currentModule = module;
1197
1198 function setHookFromEnvironment(hooks, environment, name) {
1199 var potentialHook = environment[name];
1200 hooks[name] = typeof potentialHook === "function" ? [potentialHook] : [];
1201 delete environment[name];
1202 }
1203
1204 function setHookFunction(module, hookName) {
1205 return function setHook(callback) {
1206 module.hooks[hookName].push(callback);
1207 };
1208 }
1209 }
1210
1211 function module$1(name, options, executeNow) {
1212 if (focused) {

Callers 2

module$1Function · 0.85
qunit-2.9.2.jsFile · 0.85

Calls 4

objectTypeFunction · 0.85
createModuleFunction · 0.85
setHookFromEnvironmentFunction · 0.85
setHookFunctionFunction · 0.85

Tested by

no test coverage detected