(name, options, scope)
| 1372 | }; |
| 1373 | } |
| 1374 | function processModule(name, options, scope) { |
| 1375 | var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; |
| 1376 | if (typeof options === 'function') { |
| 1377 | scope = options; |
| 1378 | options = undefined; |
| 1379 | } |
| 1380 | var module = createModule(name, options, modifiers); |
| 1381 | |
| 1382 | // Transfer any initial hooks from the options object to the 'hooks' object |
| 1383 | var testEnvironment = module.testEnvironment; |
| 1384 | var hooks = module.hooks; |
| 1385 | setHookFromEnvironment(hooks, testEnvironment, 'before'); |
| 1386 | setHookFromEnvironment(hooks, testEnvironment, 'beforeEach'); |
| 1387 | setHookFromEnvironment(hooks, testEnvironment, 'afterEach'); |
| 1388 | setHookFromEnvironment(hooks, testEnvironment, 'after'); |
| 1389 | var moduleFns = { |
| 1390 | before: makeSetHook(module, 'before'), |
| 1391 | beforeEach: makeSetHook(module, 'beforeEach'), |
| 1392 | afterEach: makeSetHook(module, 'afterEach'), |
| 1393 | after: makeSetHook(module, 'after') |
| 1394 | }; |
| 1395 | var prevModule = config.currentModule; |
| 1396 | config.currentModule = module; |
| 1397 | if (typeof scope === 'function') { |
| 1398 | moduleStack.push(module); |
| 1399 | try { |
| 1400 | var cbReturnValue = scope.call(module.testEnvironment, moduleFns); |
| 1401 | if (cbReturnValue && typeof cbReturnValue.then === 'function') { |
| 1402 | Logger.warn('Returning a promise from a module callback is not supported. ' + 'Instead, use hooks for async behavior. ' + 'This will become an error in QUnit 3.0.'); |
| 1403 | } |
| 1404 | } finally { |
| 1405 | // If the module closure threw an uncaught error during the load phase, |
| 1406 | // we let this bubble up to global error handlers. But, not until after |
| 1407 | // we teardown internal state to ensure correct module nesting. |
| 1408 | // Ref https://github.com/qunitjs/qunit/issues/1478. |
| 1409 | moduleStack.pop(); |
| 1410 | config.currentModule = module.parentModule || prevModule; |
| 1411 | } |
| 1412 | } |
| 1413 | } |
| 1414 | var focused$1 = false; // indicates that the "only" filter was used |
| 1415 | |
| 1416 | function module$1(name, options, scope) { |
no test coverage detected