Skip to content

Commit a8b48e1

Browse files
committed
chore(jev): use the standard hoisted test mock
1 parent 0c179f7 commit a8b48e1

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎apps/sim/blocks/agent-evaluation.test.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { describe, expect, it, vi } from 'vitest'
1+
/** @vitest-environment node */
2+
import { beforeEach, describe, expect, it, vi } from 'vitest'
23
import {
34
getEffectiveBlockOutputPaths,
45
getEffectiveBlockOutputs,
@@ -12,12 +13,15 @@ import { Serializer } from '@/serializer'
1213
import { useProvidersStore } from '@/stores/providers/store'
1314
import type { BlockState } from '@/stores/workflows/workflow/types'
1415

15-
vi.mock('@/blocks', async () => {
16-
const { AgentBlock } = await import('@/blocks/blocks/agent')
17-
return { getBlock: () => AgentBlock }
18-
})
16+
const { mockGetBlock } = vi.hoisted(() => ({ mockGetBlock: vi.fn() }))
17+
18+
vi.mock('@/blocks', () => ({ getBlock: mockGetBlock }))
1919

2020
describe('Agent evaluation configuration', () => {
21+
beforeEach(() => {
22+
mockGetBlock.mockReturnValue(AgentBlock)
23+
})
24+
2125
it.each(['jev-1.13.0', 'jev-latest', 'jev-preview'])(
2226
'shows native fields and credentials for %s',
2327
(model) => {

0 commit comments

Comments
 (0)