mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-15 14:22:43 +00:00
Regression tests for stale-backend detection when projects.create is missing from an older backend that still reports the same semver.
16 lines
650 B
TypeScript
16 lines
650 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { isMissingRpcMethod } from './gateway-rpc'
|
|
|
|
describe('isMissingRpcMethod', () => {
|
|
it('detects JSON-RPC method-not-found errors', () => {
|
|
expect(isMissingRpcMethod(new Error('unknown method: projects.create'))).toBe(true)
|
|
expect(isMissingRpcMethod(new Error('Method not found'))).toBe(true)
|
|
expect(isMissingRpcMethod(new Error('RPC failed: -32601'))).toBe(true)
|
|
})
|
|
|
|
it('ignores unrelated failures', () => {
|
|
expect(isMissingRpcMethod(new Error('Hermes gateway is not connected'))).toBe(false)
|
|
expect(isMissingRpcMethod(new Error('no such project'))).toBe(false)
|
|
})
|
|
})
|