MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / prepareRuns

Method prepareRuns

lib/command/run-multiple/collection.js:48–73  ·  view source on GitHub ↗

* Expands the list of selected runs to runs incl. configuration from config.multiple.

(selectedRuns, config)

Source from the content-addressed store, hash-verified

46 * Expands the list of selected runs to runs incl. configuration from config.multiple.
47 */
48 prepareRuns(selectedRuns, config) {
49 selectedRuns.forEach((selectedRun) => {
50 const runConfig = [];
51 const runName = [];
52
53 if (selectedRun === 'all') {
54 Object.keys(config.multiple).forEach(name => {
55 runName.push(name);
56 runConfig.push(config.multiple[name]);
57 });
58 } else {
59 runName.push(selectedRun.split(':')[0]);
60 runConfig.push(config.multiple[runName[0]]);
61 }
62
63 for (let i = 0; i < runConfig.length; i++) {
64 if (!runConfig[i]) {
65 throw new Error(`run ${runName[i]} was not configured in "multiple" section of config`);
66 }
67
68 this.addRun(createRun(runName[i], runConfig[i]));
69 }
70 });
71
72 return this;
73 }
74
75 /**
76 * Expands runs via the `chunks` property to multiple runs. If config.chunks is a numeric

Callers 1

createRunsFunction · 0.80

Calls 3

addRunMethod · 0.95
createRunFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected