Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

635 B
Raw Blame
import type { CommandContext } from '../types'
import { withSelectorKey } from '@/test/i18n-mock'

export function createCommandContext(overrides: Partial<CommandContext> = {}): CommandContext {
  return {
    t: withSelectorKey((key: string) => key) as CommandContext['t'],
    locale: 'en-US',
    agentsAvailable: true,
    skillsAvailable: true,
    currentApp: null,
    setThemePreference: vi.fn(),
    setLocale: vi.fn().mockResolvedValue(undefined),
    getDocsHomeUrl: () => 'https://docs.dify.ai/en',
    onError: vi.fn(),
    navigate: vi.fn(),
    openExternal: vi.fn(),
    openGenerator: vi.fn(),
    ...overrides,
  }
}