mirror of
https://github.com/stablyai/orca.git
synced 2026-11-05 19:47:27 +00:00
test: import mocked-module graphs one at a time after vi.mock (#34103)
Same Vitest registration race as the daemon-init fix: concurrent first imports can load dependencies before pending vi.mock/vi.doMock calls are registered.
This commit is contained in:
@@ -50,10 +50,9 @@ export async function loadJiraClientModule(
|
||||
})
|
||||
|
||||
// Split modules must share one graph, request queue and credential cache per reset.
|
||||
const [client, queue, api] = await Promise.all([
|
||||
import('../client'),
|
||||
import('../request-queue'),
|
||||
import('../authenticated-request')
|
||||
])
|
||||
// Why sequential: concurrent first imports can bypass Vitest's still-pending vi.doMock('os').
|
||||
const client = await import('../client')
|
||||
const queue = await import('../request-queue')
|
||||
const api = await import('../authenticated-request')
|
||||
return { ...client, ...queue, ...api }
|
||||
}
|
||||
|
||||
@@ -159,10 +159,9 @@ describe('insertPaneNextTo reparent frame', () => {
|
||||
|
||||
it('passes pane drag active callbacks into dividers created during reorder', async () => {
|
||||
setupDocument()
|
||||
const [{ insertPaneNextTo }, { createDivider }] = await Promise.all([
|
||||
import('./pane-tree-ops'),
|
||||
import('./pane-divider')
|
||||
])
|
||||
// Why sequential: concurrent first imports can bypass Vitest's still-pending vi.mock registrations.
|
||||
const { insertPaneNextTo } = await import('./pane-tree-ops')
|
||||
const { createDivider } = await import('./pane-divider')
|
||||
const parent = createMockElement('pane-split')
|
||||
const source = createPane(1)
|
||||
const target = createPane(2)
|
||||
|
||||
Reference in New Issue
Block a user