Files
codeql-action/node_modules/ava/lib/api-event-iterator.js
2025-07-15 07:33:26 +00:00

13 lines
341 B
JavaScript

export async function * asyncEventIteratorFromApi(api) {
// TODO: support multiple runs (watch mode)
const {value: plan} = await api.events('run').next();
for await (const stateChange of plan.status.events('stateChange')) {
yield stateChange;
if (stateChange.type === 'end' || stateChange.type === 'interrupt') {
break;
}
}
}