mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-08-29 04:26:38 +00:00
21 lines
961 B
TypeScript
21 lines
961 B
TypeScript
import { Context } from '@deepseek-ai/cordis'
|
|
import type { Agent } from '@deepseek-ai/dsh-agent'
|
|
import type { FileReferenceCandidate } from '@deepseek-ai/dsh-file-reference/types'
|
|
import { describe, expect, it, vi } from 'vitest'
|
|
import { SessionFileReferences } from '../src/file-references.ts'
|
|
|
|
describe('SessionFileReferences', () => {
|
|
it('delegates the resolved Agent, query, and cancellation signal unchanged', async () => {
|
|
const ctx = new Context()
|
|
const candidates: FileReferenceCandidate[] = [{ path: 'src', kind: 'directory' }]
|
|
const list = vi.fn(() => Promise.resolve(candidates))
|
|
ctx.provide('fileReferences', { list } as never)
|
|
const adapter = new SessionFileReferences(ctx)
|
|
const agent = { id: 'target' } as unknown as Agent
|
|
const signal = new AbortController().signal
|
|
|
|
await expect(adapter.list(agent, 'sr', signal)).resolves.toBe(candidates)
|
|
expect(list).toHaveBeenCalledWith(agent, 'sr', signal)
|
|
})
|
|
})
|