MCPcopy
hub / github.com/webpack/webpack / makeModule

Function makeModule

test/HtmlParser.unittest.js:26–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 * @returns {{ module: EXPECTED_ANY, presentationalDependencies: EXPECTED_OBJECT[], dependencies: EXPECTED_OBJECT[], warnings: EXPECTED_OBJECT[], errors: EXPECTED_OBJECT[] }} test doubles
25 */
26const makeModule = () => {
27 /** @type {EXPECTED_OBJECT[]} */
28 const presentationalDependencies = [];
29 /** @type {EXPECTED_OBJECT[]} */
30 const dependencies = [];
31 /** @type {EXPECTED_OBJECT[]} */
32 const warnings = [];
33 /** @type {EXPECTED_OBJECT[]} */
34 const errors = [];
35 const module = {
36 resource: path.resolve(__dirname, "index.html"),
37 buildInfo: /** @type {Record<string, EXPECTED_ANY>} */ ({}),
38 buildMeta: {},
39 identifier() {
40 return this.resource;
41 },
42 addPresentationalDependency(/** @type {EXPECTED_OBJECT} */ dependency) {
43 presentationalDependencies.push(dependency);
44 },
45 addDependency(/** @type {EXPECTED_OBJECT} */ dependency) {
46 dependencies.push(dependency);
47 },
48 addCodeGenerationDependency() {},
49 addWarning(/** @type {EXPECTED_OBJECT} */ warning) {
50 warnings.push(warning);
51 },
52 addError(/** @type {EXPECTED_OBJECT} */ error) {
53 errors.push(error);
54 }
55 };
56 return { module, presentationalDependencies, dependencies, warnings, errors };
57};
58
59/**
60 * @param {EXPECTED_ANY} module module double

Callers 2

sourceRequestsFunction · 0.70

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected