mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
chore: uptick
This commit is contained in:
parent
cb31732c4f
commit
8e06db56fd
14 changed files with 1712 additions and 1362 deletions
21
ui-tui/src/__tests__/asCommandDispatch.test.ts
Normal file
21
ui-tui/src/__tests__/asCommandDispatch.test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { asCommandDispatch } from '../lib/rpc.js'
|
||||
|
||||
describe('asCommandDispatch', () => {
|
||||
it('parses exec, alias, and skill', () => {
|
||||
expect(asCommandDispatch({ type: 'exec', output: 'hi' })).toEqual({ type: 'exec', output: 'hi' })
|
||||
expect(asCommandDispatch({ type: 'alias', target: 'help' })).toEqual({ type: 'alias', target: 'help' })
|
||||
expect(asCommandDispatch({ type: 'skill', name: 'x', message: 'do' })).toEqual({
|
||||
type: 'skill',
|
||||
name: 'x',
|
||||
message: 'do'
|
||||
})
|
||||
})
|
||||
|
||||
it('rejects malformed payloads', () => {
|
||||
expect(asCommandDispatch(null)).toBeNull()
|
||||
expect(asCommandDispatch({ type: 'alias' })).toBeNull()
|
||||
expect(asCommandDispatch({ type: 'skill', name: 1 })).toBeNull()
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue