Skip to content

Commit 07c8838

Browse files
committed
chore(test/helpers): delete 2 dead modules + colocate 18 unused exports
Deleted entire files (zero adopted consumers): - helpers/constants.mts (72 LOC, 7 TEST_* fixture constants) - helpers/cli-process-pool.mts (223 LOC, CliProcessPool class + cleanupProcessPool + getProcessPool — the pool was never adopted by tests, all spawn through executeCliInScratch instead) Colocated (used only as internal signatures): - mock-auth.mts: MockAuthOptions, MockLoginOptions, MockTokenOptions, MockOrgOptions, simulateDelay - mock-malware-api.mts: ExtendedAlert, CompactSocketArtifactWithScore - sdk-test-helpers.mts: getMockHandleApiCall, getMockSetupSdk + delete setupSdkMockWithCustomSdk (entirely dead) - environment.mts: delete resetExitCode, setupTestWithCleanup (entirely dead) + drop now-unused afterEach import - test-fixtures.mts: delete createTempFixtures (entirely dead) helpers/index.mts: drop the constants.mts barrel re-export.
1 parent 3361dcb commit 07c8838

8 files changed

Lines changed: 10 additions & 403 deletions

File tree

packages/cli/test/helpers/cli-process-pool.mts

Lines changed: 0 additions & 223 deletions
This file was deleted.

packages/cli/test/helpers/constants.mts

Lines changed: 0 additions & 72 deletions
This file was deleted.

packages/cli/test/helpers/environment.mts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* management.
55
*/
66

7-
import { afterEach, beforeEach, vi } from 'vitest'
7+
import { beforeEach, vi } from 'vitest'
88

99
/**
1010
* Clear all mocks manually.
@@ -13,13 +13,6 @@ export function clearAllMocks(): void {
1313
vi.clearAllMocks()
1414
}
1515

16-
/**
17-
* Reset process.exitCode manually.
18-
*/
19-
export function resetExitCode(): void {
20-
process.exitCode = undefined
21-
}
22-
2316
/**
2417
* Setup standard test environment with beforeEach hook Clears all mocks and
2518
* resets process.exitCode.
@@ -30,25 +23,3 @@ export function setupTestEnvironment(): void {
3023
process.exitCode = undefined
3124
})
3225
}
33-
34-
/**
35-
* Setup and cleanup for a test with custom initialization.
36-
*/
37-
export function setupTestWithCleanup(
38-
setup?: () => void | Promise<void>,
39-
cleanup?: () => void | Promise<void>,
40-
): void {
41-
beforeEach(async () => {
42-
vi.clearAllMocks()
43-
process.exitCode = undefined
44-
if (setup) {
45-
await setup()
46-
}
47-
})
48-
49-
if (cleanup) {
50-
afterEach(async () => {
51-
await cleanup()
52-
})
53-
}
54-
}

packages/cli/test/helpers/index.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
export * from './cli-execution.mts'
7-
export * from './constants.mts'
87
export * from './environment.mts'
98
export * from './generate-report-test-helpers.mts'
109
export * from './handle-test-helpers.mts'

0 commit comments

Comments
 (0)