(method, args)
| 7259 | return this |
| 7260 | |
| 7261 | function dispatch(method, args) { |
| 7262 | if (reporters.length === 0 && fallbackReporter !== null) { |
| 7263 | reporters.push(fallbackReporter) |
| 7264 | } |
| 7265 | const fns = [] |
| 7266 | for (const reporter of reporters) { |
| 7267 | addFn(fns, reporter, method, args) |
| 7268 | } |
| 7269 | |
| 7270 | return new Promise(function(resolve) { |
| 7271 | queueRunnerFactory({ |
| 7272 | queueableFns: fns, |
| 7273 | onComplete: resolve, |
| 7274 | isReporter: true, |
| 7275 | onMultipleDone: function() { |
| 7276 | onLateError( |
| 7277 | new Error( |
| 7278 | "An asynchronous reporter callback called its 'done' callback " + "more than once." |
| 7279 | ) |
| 7280 | ) |
| 7281 | }, |
| 7282 | }) |
| 7283 | }) |
| 7284 | } |
| 7285 | |
| 7286 | function addFn(fns, reporter, method, args) { |
| 7287 | const fn = reporter[method] |
no test coverage detected