Skip to content

Commit fb12805

Browse files
committed
fix(mothership): fix function execute tests
1 parent 7cd4545 commit fb12805

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

apps/sim/app/api/function/execute/route.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ vi.mock('@/lib/auth/hybrid', () => ({
2424

2525
vi.mock('@/lib/execution/e2b', () => ({
2626
executeInE2B: mockExecuteInE2B,
27+
executeShellInE2B: vi.fn(),
28+
}))
29+
30+
vi.mock('@/lib/copilot/request/tools/files', () => ({
31+
FORMAT_TO_CONTENT_TYPE: {
32+
json: 'application/json',
33+
csv: 'text/csv',
34+
txt: 'text/plain',
35+
md: 'text/markdown',
36+
html: 'text/html',
37+
},
38+
normalizeOutputWorkspaceFileName: vi.fn((p: string) => p.replace(/^files\//, '')),
39+
resolveOutputFormat: vi.fn(() => 'json'),
40+
}))
41+
42+
vi.mock('@/lib/uploads/contexts/workspace/workspace-file-manager', () => ({
43+
uploadWorkspaceFile: vi.fn(),
44+
}))
45+
46+
vi.mock('@/lib/workflows/utils', () => ({
47+
getWorkflowById: vi.fn(),
2748
}))
2849

2950
vi.mock('@/lib/core/config/feature-flags', () => ({
@@ -32,6 +53,7 @@ vi.mock('@/lib/core/config/feature-flags', () => ({
3253
isProd: false,
3354
isDev: false,
3455
isTest: true,
56+
isEmailVerificationEnabled: false,
3557
}))
3658

3759
import { validateProxyUrl } from '@/lib/core/security/input-validation'

0 commit comments

Comments
 (0)