Skip to content

Commit 8555584

Browse files
author
IM.codes
committed
Fix transport drain lifecycle test
1 parent f93981b commit 8555584

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/daemon/transport-status-lifecycle.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,15 @@ describe('batched queuing', () => {
145145
mock = makeMockProvider();
146146
runtime = new TransportSessionRuntime(mock.provider, 'deck_test');
147147
drainLog = [];
148-
runtime.onDrain = (merged, count) => drainLog.push({ merged, count });
148+
runtime.onDrain = (...args) => {
149+
const merged = typeof args[1] === 'string'
150+
? args[1]
151+
: (typeof args[0] === 'string' ? args[0] : '');
152+
const count = typeof args[2] === 'number'
153+
? args[2]
154+
: (typeof args[1] === 'number' ? args[1] : 0);
155+
drainLog.push({ merged, count });
156+
};
149157
await runtime.initialize(defaultConfig);
150158
});
151159

0 commit comments

Comments
 (0)