• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adobe / reactor-turbine / 26974271630

04 Jun 2026 07:23PM UTC coverage: 18.928% (-77.0%) from 95.912%
26974271630

Pull #201

github

web-flow
Merge 99f374fa8 into 4a42733a4
Pull Request #201: Platir 64071 update vulnerability chain

36 of 379 branches covered (9.5%)

Branch coverage included in aggregate %.

4 of 6 new or added lines in 1 file covered. (66.67%)

640 existing lines in 47 files now uncovered.

197 of 852 relevant lines covered (23.12%)

1.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.5
/src/createModuleProvider.js
1
/***************************************************************************************
2
 * (c) 2017 Adobe. All rights reserved.
3
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License. You may obtain a copy
5
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
 *
7
 * Unless required by applicable law or agreed to in writing, software distributed under
8
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
 * OF ANY KIND, either express or implied. See the License for the specific language
10
 * governing permissions and limitations under the License.
11
 ****************************************************************************************/
12

13
var validateInjectedParams = require('./helpers/validate-injected-params');
3✔
14

15
function injectCreateModuleProvider({ extractModuleExports, logger }) {
16
  return function createModuleProvider() {
6✔
UNCOV
17
    var moduleByReferencePath = {};
×
18

UNCOV
19
    var getModule = function (referencePath) {
×
UNCOV
20
      var module = moduleByReferencePath[referencePath];
×
21

UNCOV
22
      if (!module) {
×
UNCOV
23
        throw new Error('Module ' + referencePath + ' not found.');
×
24
      }
25

UNCOV
26
      return module;
×
27
    };
28

UNCOV
29
    var registerModule = function (
×
30
      referencePath,
31
      moduleDefinition,
32
      extensionName,
33
      require,
34
      turbine
35
    ) {
UNCOV
36
      var module = {
×
37
        definition: moduleDefinition,
38
        extensionName: extensionName,
39
        require: require,
40
        turbine: turbine
41
      };
UNCOV
42
      module.require = require;
×
UNCOV
43
      moduleByReferencePath[referencePath] = module;
×
44
    };
45

UNCOV
46
    var hydrateCache = function () {
×
UNCOV
47
      Object.keys(moduleByReferencePath).forEach(function (referencePath) {
×
UNCOV
48
        try {
×
UNCOV
49
          getModuleExports(referencePath);
×
50
        } catch (e) {
51
          var errorMessage =
UNCOV
52
            'Error initializing module ' +
×
53
            referencePath +
54
            '. ' +
55
            e.message +
56
            (e.stack ? '\n' + e.stack : '');
×
UNCOV
57
          logger.error(errorMessage);
×
58
        }
59
      });
60
    };
61

UNCOV
62
    var getModuleExports = function (referencePath) {
×
UNCOV
63
      var module = getModule(referencePath);
×
64

65
      // Using hasOwnProperty instead of a falsey check because the module could export undefined
66
      // in which case we don't want to execute the module each time the exports is requested.
UNCOV
67
      if (!module.hasOwnProperty('exports')) {
×
UNCOV
68
        module.exports = extractModuleExports(
×
69
          module.definition.script,
70
          module.require,
71
          module.turbine
72
        );
73
      }
74

UNCOV
75
      return module.exports;
×
76
    };
77

UNCOV
78
    var getModuleDefinition = function (referencePath) {
×
UNCOV
79
      return getModule(referencePath).definition;
×
80
    };
81

UNCOV
82
    var getModuleExtensionName = function (referencePath) {
×
UNCOV
83
      return getModule(referencePath).extensionName;
×
84
    };
85

UNCOV
86
    return {
×
87
      registerModule: registerModule,
88
      hydrateCache: hydrateCache,
89
      getModuleExports: getModuleExports,
90
      getModuleDefinition: getModuleDefinition,
91
      getModuleExtensionName: getModuleExtensionName
92
    };
93
  };
94
}
95

96
const validateInjection = validateInjectedParams(injectCreateModuleProvider);
3✔
97

98
module.exports = validateInjection({
3✔
99
  extractModuleExports: require('./extractModuleExports'),
100
  logger: require('./logger')
101
});
102

103
if (REACTOR_KARMA_CI_UNIT_TEST_MODE) {
3!
104
  /* START.TESTS_ONLY */
105
  module.exports.injectCreateModuleProvider = validateInjection;
3✔
106
  /* END.TESTS_ONLY */
107
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc