Fix nested repository validation fixtures

This commit is contained in:
Brennan Benson
2026-11-10 21:40:26 -08:00
parent 3051aa9c02
commit 3600cbebb7
3 changed files with 10 additions and 3 deletions
@@ -1,5 +1,5 @@
import { afterEach, expect, it, vi } from 'vitest'
import { handlers } from './filesystem-test-harness'
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
import { handlers, resetFilesystemIpcMocks } from './filesystem-test-harness'
import type { StateWriteListener } from '../../persistence/loading-store/write-scheduling'
const read = vi.hoisted(() =>
@@ -26,6 +26,8 @@ import { registerFilesystemGitStatusHandlers } from './filesystem-git-status-han
import { createFilesystemHandlerContext } from './filesystem-handler-context'
import { createSenderScopedRequestCancellations } from '../sender-scoped-request-cancellation'
beforeEach(resetFilesystemIpcMocks)
const originalPlatform = process.platform
afterEach(() =>
Object.defineProperty(process, 'platform', { configurable: true, value: originalPlatform })
@@ -120,6 +120,7 @@ it.each([1, 10])(
]
})
await act(() => vi.advanceTimersByTimeAsync(1000))
await act(() => vi.advanceTimersByTimeAsync(1000))
const initialPublications = fixture.publications.length
fixture.projections.clear()
act(() => start())
@@ -196,6 +197,7 @@ it.each(['hide', 'input'] as const)(
]
})
await act(() => vi.advanceTimersByTimeAsync(1000))
await act(() => vi.advanceTimersByTimeAsync(1000))
const empty = fixture.result.current[0].ignored
const before = fixture.publications.length
await act(async () => {
@@ -84,7 +84,10 @@ beforeEach(() => {
cancelGenerateCommitMessage: gitCancelGenerateCommitMessage
},
runtime: { call: runtimeCall },
runtimeEnvironments: { call: runtimeEnvironmentTransportCall }
runtimeEnvironments: {
call: runtimeEnvironmentTransportCall,
cancelSubscription: vi.fn().mockResolvedValue(undefined)
}
}
})
})