(failure: {
suiteName?: string;
testName?: string;
message: string;
location?: string;
})
| 182 | } |
| 183 | |
| 184 | function queueFailureDiagnostic(failure: { |
| 185 | suiteName?: string; |
| 186 | testName?: string; |
| 187 | message: string; |
| 188 | location?: string; |
| 189 | }): void { |
| 190 | const key = getFailureKey(failure.suiteName, failure.testName); |
| 191 | if (!key) { |
| 192 | emitFailureFragment(failure); |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | const durationMs = pendingFailureDurations.get(key); |
| 197 | if (durationMs !== undefined) { |
| 198 | pendingFailureDurations.delete(key); |
| 199 | emitFailureFragment({ ...failure, durationMs }); |
| 200 | return; |
| 201 | } |
| 202 | |
| 203 | const queued = pendingFailureDiagnostics.get(key) ?? []; |
| 204 | queued.push(failure); |
| 205 | pendingFailureDiagnostics.set(key, queued); |
| 206 | } |
| 207 | |
| 208 | function flushQueuedFailureDiagnostics(): void { |
| 209 | for (const [key, failures] of pendingFailureDiagnostics.entries()) { |
no test coverage detected