* @param {string} id * @param {number} percentage * @return {Array } modified files
(id, percentage)
| 136 | * @return {Array<string>} modified files |
| 137 | */ |
| 138 | function removeFromRuntimeSource(id, percentage) { |
| 139 | const possiblyModifiedSourceFiles = filesContainingPattern( |
| 140 | containRuntimeSource.map((dir) => `${dir}/**/*.js`), |
| 141 | id |
| 142 | ); |
| 143 | if (possiblyModifiedSourceFiles.length > 0) { |
| 144 | jscodeshift([ |
| 145 | `--no-babel`, |
| 146 | `--transform ${__dirname}/jscodeshift/remove-experiment-runtime.js`, |
| 147 | `--isExperimentOnLaunched=${percentage}`, |
| 148 | `--isExperimentOnExperiment=${id}`, |
| 149 | ...possiblyModifiedSourceFiles, |
| 150 | ]); |
| 151 | } |
| 152 | return possiblyModifiedSourceFiles; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * @param {string} id |
no test coverage detected