Skip to content

Commit fa4a138

Browse files
committed
refactor(test): remove unused setupStandardOutputMocks calls
Remove setupStandardOutputMocks() helper calls from tests that don't need mocks. These tests work with pure functions and pass without the mock setup helper. The setupStandardOutputMocks() helper doesn't work with Vitest because vi.mock() must be at top-level for proper hoisting - calling it from within a function breaks mock initialization.
1 parent e34c0cc commit fa4a138

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

packages/cli/src/commands/audit-log/output-audit-log.test.mts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ import { describe, expect, it } from 'vitest'
22

33
import FIXTURE from './audit-fixture.json' with { type: 'json' }
44
import { outputAsJson, outputAsMarkdown } from './output-audit-log.mts'
5-
import { setupStandardOutputMocks } from '../../../test/helpers/index.mts'
65
import { createSuccessResult } from '../../../test/helpers/mocks.mts'
76

87
import type { SocketSdkSuccessResult } from '@socketsecurity/sdk'
98

10-
setupStandardOutputMocks()
11-
129
type AuditLogs = SocketSdkSuccessResult<'getAuditLogEvents'>['data']['results']
1310

1411
describe('output-audit-log', () => {

packages/cli/src/commands/scan/output-scan-report.test.mts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { describe, expect, it } from 'vitest'
22

33
import { toJsonReport, toMarkdownReport } from './output-scan-report.mts'
4-
import { setupStandardOutputMocks } from '../../../test/helpers/index.mts'
54
import { SOCKET_WEBSITE_URL } from '../../constants/socket.mts'
65

76
import type { ScanReport } from './generate-report.mts'
87

9-
setupStandardOutputMocks()
10-
118
describe('output-scan-report', () => {
129
describe('toJsonReport', () => {
1310
it('should be able to generate a healthy json report', () => {

0 commit comments

Comments
 (0)