mirror of
https://github.com/stablyai/orca.git
synced 2026-10-13 16:02:49 +00:00
fix: repair test failures from mobile feature additions
- Add shouldRunSetupForCreate to hooks mock in orca-runtime tests - Fix send() helper to use rest args, avoiding extra undefined in IPC calls Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { WorktreeMeta } from '../../shared/types'
|
||||
import { addWorktree, listWorktrees, removeWorktree } from '../git/worktree'
|
||||
import { createSetupRunnerScript, getEffectiveHooks, runHook } from '../hooks'
|
||||
import {
|
||||
createSetupRunnerScript,
|
||||
getEffectiveHooks,
|
||||
runHook,
|
||||
shouldRunSetupForCreate
|
||||
} from '../hooks'
|
||||
import { OrchestrationDb } from './orchestration/db'
|
||||
import { OrcaRuntimeService } from './orca-runtime'
|
||||
|
||||
@@ -39,7 +44,8 @@ vi.mock('../git/worktree', () => ({
|
||||
vi.mock('../hooks', () => ({
|
||||
createSetupRunnerScript: vi.fn(),
|
||||
getEffectiveHooks: vi.fn().mockReturnValue(null),
|
||||
runHook: vi.fn().mockResolvedValue({ success: true, output: '' })
|
||||
runHook: vi.fn().mockResolvedValue({ success: true, output: '' }),
|
||||
shouldRunSetupForCreate: vi.fn().mockReturnValue(false)
|
||||
}))
|
||||
|
||||
vi.mock('../ipc/worktree-logic', async (importOriginal) => {
|
||||
@@ -1320,6 +1326,7 @@ describe('OrcaRuntimeService', () => {
|
||||
|
||||
computeWorktreePathMock.mockReturnValue('/tmp/workspaces/runtime-hook-test')
|
||||
ensurePathWithinWorkspaceMock.mockReturnValue('/tmp/workspaces/runtime-hook-test')
|
||||
vi.mocked(shouldRunSetupForCreate).mockReturnValue(true)
|
||||
vi.mocked(getEffectiveHooks).mockReturnValue({
|
||||
scripts: {
|
||||
setup: 'pnpm worktree:setup'
|
||||
|
||||
@@ -200,9 +200,9 @@ function registerRuntimeWindowLifecycle(
|
||||
runtime: OrcaRuntimeService
|
||||
): void {
|
||||
runtime.attachWindow(mainWindow.id)
|
||||
const send = (channel: string, data?: unknown): void => {
|
||||
const send = (channel: string, ...args: unknown[]): void => {
|
||||
if (!mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send(channel, data)
|
||||
mainWindow.webContents.send(channel, ...args)
|
||||
}
|
||||
}
|
||||
runtime.setNotifier({
|
||||
|
||||
Reference in New Issue
Block a user