fix(core): reject unknown session interrupts
This commit is contained in:
parent
eec6cd5234
commit
fb8d775fec
3 changed files with 35 additions and 13 deletions
|
|
@ -156,13 +156,16 @@ describe("SessionV2.prompt", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
it.effect("delegates interruption without requiring a recorded Session", () =>
|
||||
it.effect("rejects interruption for an unknown Session", () =>
|
||||
Effect.gen(function* () {
|
||||
const session = yield* SessionV2.Service
|
||||
interruptCalls.length = 0
|
||||
const missing = SessionV2.ID.make("ses_missing")
|
||||
|
||||
yield* session.interrupt(SessionV2.ID.make("ses_missing"))
|
||||
expect(interruptCalls).toEqual([SessionV2.ID.make("ses_missing")])
|
||||
expect(yield* session.interrupt(missing).pipe(Effect.flip)).toEqual(
|
||||
new SessionV2.NotFoundError({ sessionID: missing }),
|
||||
)
|
||||
expect(interruptCalls).toEqual([])
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue