fix(typert): close remote gateway review gaps

This commit is contained in:
imccyu
2026-08-06 18:43:31 +08:00
parent 22bec5e63f
commit 1ea5507bf8
11 changed files with 77 additions and 38 deletions

View File

@@ -998,14 +998,16 @@ describe('TypertGatewayService', () => {
}),
})
expect(invalid.status).toBe(200)
await expect(invalid.json()).resolves.toMatchObject({
const invalidBody = await invalid.json() as unknown
expect(invalidBody).toMatchObject({
type: 'server-response',
rpcId: 'rpc-invalid',
result: {
ok: false,
error: { code: 'internal', message: expect.stringContaining('plain-object args field') },
error: { code: 'internal' },
},
})
expect(JSON.stringify(invalidBody)).toContain('plain-object args field')
await removeStrict()
strictActive = false
@@ -1020,14 +1022,16 @@ describe('TypertGatewayService', () => {
}),
})
expect(withdrawn.status).toBe(200)
await expect(withdrawn.json()).resolves.toMatchObject({
const withdrawnBody = await withdrawn.json() as unknown
expect(withdrawnBody).toMatchObject({
type: 'server-response',
rpcId: 'rpc-withdrawn',
result: {
ok: false,
error: { code: 'internal', message: expect.stringContaining('strict definition was withdrawn') },
error: { code: 'internal' },
},
})
expect(JSON.stringify(withdrawnBody)).toContain('strict definition was withdrawn')
const unclaimed = await fetch(`${server.origin}/api/legacy/list`, { method: 'POST' })
expect(unclaimed.status).toBe(404)