Skip to content

Commit 4cfa8d2

Browse files
waleedlatif1claude
andcommitted
fix(tests): mock isHosted in input-validation and function-execute tests
Tests that assert self-hosted localhost behavior need isHosted=false, which is not guaranteed in CI where NEXT_PUBLIC_APP_URL is set to the hosted domain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0572f6b commit 4cfa8d2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ vi.mock('@/lib/execution/e2b', () => ({
2626
executeInE2B: mockExecuteInE2B,
2727
}))
2828

29+
vi.mock('@/lib/core/config/feature-flags', () => ({
30+
isHosted: false,
31+
isE2bEnabled: false,
32+
isProd: false,
33+
isDev: false,
34+
isTest: true,
35+
}))
36+
2937
import { validateProxyUrl } from '@/lib/core/security/input-validation'
3038
import { POST } from '@/app/api/function/execute/route'
3139

apps/sim/lib/core/security/input-validation.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import { validateUrlWithDNS } from '@/lib/core/security/input-validation.server'
2323
import { sanitizeForLogging } from '@/lib/core/security/redaction'
2424

2525
vi.mock('@sim/logger', () => loggerMock)
26+
vi.mock('@/lib/core/config/feature-flags', () => ({
27+
isHosted: false,
28+
}))
2629

2730
describe('validatePathSegment', () => {
2831
describe('valid inputs', () => {

0 commit comments

Comments
 (0)