mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 16:02:37 +00:00
test(codex): expect the neutral JSON reply in the Windows hook test
The managed Codex hook now answers with `{}` on every path, POSIX and
Windows alike. The POSIX test was updated with that change; this one
was not, because it is skipped off Windows and only runs inside the
packaging job, so a local suite run stays green either way.
Expect the neutral reply where the script actually runs. The
script-removed case keeps an empty stdout: the echo cannot run when
the script is gone.
This commit is contained in:
@@ -111,7 +111,10 @@ describe.skipIf(process.platform !== 'win32')('Codex hook delivery through Power
|
||||
.map((payload) => invoke(getManagedCommand(scriptPath), payload))
|
||||
)
|
||||
for (const result of results) {
|
||||
expect(result).toMatchObject({ code: 0, stdout: '', stderr: '', timedOut: false })
|
||||
expect(result).toMatchObject({ code: 0, stderr: '', timedOut: false })
|
||||
// Why: the managed script answers Codex with a neutral JSON object, the same
|
||||
// contract the POSIX runner emits; cmd's echo appends CRLF.
|
||||
expect(result.stdout.trim()).toBe('{}')
|
||||
}
|
||||
}
|
||||
expect(posts).toHaveLength(CODEX_EVENTS.length)
|
||||
@@ -122,12 +125,10 @@ describe.skipIf(process.platform !== 'win32')('Codex hook delivery through Power
|
||||
expect(post.get('worktreeId')).toBe(env.ORCA_WORKTREE_ID)
|
||||
}
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()))
|
||||
expect(await invoke(getManagedCommand(scriptPath), payloads[0])).toMatchObject({
|
||||
code: 0,
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
timedOut: false
|
||||
})
|
||||
const afterServerClosed = await invoke(getManagedCommand(scriptPath), payloads[0])
|
||||
expect(afterServerClosed).toMatchObject({ code: 0, stderr: '', timedOut: false })
|
||||
// The script still runs with Orca context, so it still answers with neutral JSON.
|
||||
expect(afterServerClosed.stdout.trim()).toBe('{}')
|
||||
rmSync(scriptPath)
|
||||
expect(await invoke(getManagedCommand(scriptPath), payloads[0])).toMatchObject({
|
||||
code: 0,
|
||||
|
||||
Reference in New Issue
Block a user