Skip to content

Commit ec70158

Browse files
committed
Fix test
1 parent fdca2ed commit ec70158

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/api-event-iterator.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import {on} from 'node:events';
2-
31
export async function * asyncEventIteratorFromApi(api) {
4-
for await (const [plan] of on(api, 'run')) {
5-
6-
for await (const [stateChange] of on(plan.status, 'stateChange')) {
2+
for await (const plan of api.events('run')) {
3+
for await (const stateChange of plan.status.events('stateChange')) {
74
yield stateChange;
5+
6+
if (stateChange.type === 'end' || stateChange.type === 'interrupt') {
7+
break;
8+
}
89
}
10+
11+
// todo: support multiple runs (watch mode)
12+
break;
913
}
1014
}

0 commit comments

Comments
 (0)