Skip to content

Commit af58166

Browse files
committed
test(runtime): call the job handler with its run context
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5opKoaTFmNRbYvKobt
1 parent 50305f4 commit af58166

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/runtime/src/sandbox/action-job-capability-denial-is-a-refusal.integration.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('[#26965] an action or job body\'s capability denial is a coded refusal
171171
const e = await boot();
172172
const { handler, bodyLog } = bindJob(e, gate.source, []);
173173

174-
const err: any = await handler().then(() => null, (x) => x);
174+
const err: any = await handler({ jobId: 'run_1' }).then(() => null, (x) => x);
175175
expect(err, 'the denied call must fail the run').not.toBeNull();
176176
expect(err.code).toBe('INSUFFICIENT_PRIVILEGES');
177177
expect(err.status).toBe(403);
@@ -192,7 +192,7 @@ describe('[#26965] an action or job body\'s capability denial is a coded refusal
192192
it('job control — the same body WITH the capability runs', async () => {
193193
const e = await boot();
194194
const { handler, bodyLog } = bindJob(e, GATES[0].source, ['api.read']);
195-
await expect(handler()).resolves.toBeUndefined();
195+
await expect(handler({ jobId: 'run_1' })).resolves.toBeUndefined();
196196
expect(bodyLog.lines.filter((l) => l.level === 'error')).toEqual([]);
197197
}, 30_000);
198198
});

0 commit comments

Comments
 (0)