fix: replace mockModulePreservingExports with mock.module for tsc compat
This commit is contained in:
parent
e0382ce2d4
commit
3e29504ca3
|
|
@ -30,9 +30,13 @@ mock.module('src/utils/config.ts', () => ({
|
|||
enableConfigs: mock(() => {}),
|
||||
}))
|
||||
|
||||
const mockSwitchSession = mock(() => {})
|
||||
|
||||
mock.module('../../../bootstrap/state.js', () => ({
|
||||
setOriginalCwd: mock(() => {}),
|
||||
addSlowOperation: mock(() => {}),
|
||||
switchSession: mockSwitchSession,
|
||||
getSessionProjectDir: mock(() => null),
|
||||
}))
|
||||
|
||||
const mockGetDefaultAppState = mock(() => ({
|
||||
|
|
@ -87,9 +91,9 @@ const mockResolveSessionFilePath = mock(async () => ({
|
|||
projectPath: '/tmp',
|
||||
fileSize: 100,
|
||||
}))
|
||||
mockModulePreservingExports('../../../utils/sessionStoragePortable.js', {
|
||||
mock.module('../../../utils/sessionStoragePortable.js', () => ({
|
||||
resolveSessionFilePath: mockResolveSessionFilePath,
|
||||
})
|
||||
}))
|
||||
|
||||
const mockGetMainLoopModel = mock(() => 'claude-sonnet-4-6')
|
||||
|
||||
|
|
@ -755,7 +759,6 @@ describe('AcpAgent', () => {
|
|||
expect(commit.input).toEqual({ hint: '[message]' })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('sessionId alignment with global state', () => {
|
||||
test('newSession calls switchSession with the generated sessionId', async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user