(rootTest, coverage)
| 185 | } |
| 186 | |
| 187 | function collectCoverage(rootTest, coverage) { |
| 188 | if (!coverage) { |
| 189 | return null; |
| 190 | } |
| 191 | |
| 192 | let summary = null; |
| 193 | |
| 194 | try { |
| 195 | summary = coverage.summary(); |
| 196 | } catch (err) { |
| 197 | rootTest.diagnostic(`Warning: Could not report code coverage. ${err}`); |
| 198 | rootTest.harness.success = false; |
| 199 | process.exitCode = kGenericUserError; |
| 200 | } |
| 201 | |
| 202 | try { |
| 203 | coverage.cleanup(); |
| 204 | } catch (err) { |
| 205 | rootTest.diagnostic(`Warning: Could not clean up code coverage. ${err}`); |
| 206 | rootTest.harness.success = false; |
| 207 | process.exitCode = kGenericUserError; |
| 208 | } |
| 209 | |
| 210 | return summary; |
| 211 | } |
| 212 | |
| 213 | function setupFailureStateFile(rootTest, globalOptions) { |
| 214 | if (!globalOptions.rerunFailuresFilePath) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…