* Expands runs via the `chunks` property to multiple runs. If config.chunks is a numeric * value the list of scenario files is divided by this number. If config.chunks is a function, * the function with the list of scenario files itself is called.
(config)
| 78 | * the function with the list of scenario files itself is called. |
| 79 | */ |
| 80 | prepareChunks(config) { |
| 81 | this.runs.forEach((run) => { |
| 82 | const runName = run.getName(); |
| 83 | const runConfig = run.getConfig(); |
| 84 | const patterns = []; |
| 85 | patterns.push(run.tests || config.tests); |
| 86 | |
| 87 | if (config.gherkin && config.gherkin.features) { |
| 88 | patterns.push(config.gherkin.features); |
| 89 | } |
| 90 | |
| 91 | if (!runConfig.chunks || !patterns.length) { |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | if (runConfig.gherkin && config.gherkin.features) { |
| 96 | patterns.push(runConfig.gherkin.features); |
| 97 | } |
| 98 | |
| 99 | createChunks(runConfig, patterns).forEach((runChunkConfig, index) => { |
| 100 | const run = createRun(`${runName}:chunk${index + 1}`, runChunkConfig); |
| 101 | run.setOriginalName(runName); |
| 102 | this.addRun(run); |
| 103 | }); |
| 104 | |
| 105 | this.removeRun(runName); |
| 106 | }); |
| 107 | |
| 108 | return this; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Expands browser declared via `browsers` property to multiple |
no test coverage detected