mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
feat: integrate fork work onto upstream main (squashed)
Squash-merge of feat/autofix-pr-test (69 commits) onto upstream/main with -X ours strategy (upstream as authoritative for content conflicts). Key features brought in from fork: - LocalMemoryRecall + VaultHttpFetch tools (end-to-end wired) - /local-memory, /local-vault, /memory-stores, /skill-store interactive panels - /agents-platform, /schedule, /vault command scaffolding - /login: switch / replace / remove of workspace API key - statusline refactor (built-in status row, /statusline as info command) - autofix-pr command + workflow Conflict resolutions (upstream-wins): - 10 .js command stubs kept from upstream (alongside fork's .ts implementations) - src/components/BuiltinStatusLine.tsx accepted upstream's deletion (fork's wire-up references in StatusLine.tsx will be cleaned up next) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
45
tests/mocks/childProcess.ts
Normal file
45
tests/mocks/childProcess.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Shared mock for `node:child_process`.
|
||||
*
|
||||
* Usage:
|
||||
* import { mock } from 'bun:test'
|
||||
* import { childProcessMock, execFileMock, execFileSyncMock } from 'tests/mocks/childProcess'
|
||||
* mock.module('node:child_process', () => childProcessMock)
|
||||
*
|
||||
* Call `execFileMock.mockImplementation(...)` or `execFileSyncMock.mockImplementation(...)`
|
||||
* before each test that needs specific behavior.
|
||||
*/
|
||||
import { mock } from 'bun:test'
|
||||
|
||||
// execFile: node-style callback (cmd, args, opts?, callback)
|
||||
export const execFileMock = mock(
|
||||
(
|
||||
_cmd: string,
|
||||
_args: string[],
|
||||
_optsOrCb?: unknown,
|
||||
_cb?: (err: Error | null, stdout: string, stderr: string) => void,
|
||||
) => {
|
||||
const cb =
|
||||
typeof _optsOrCb === 'function'
|
||||
? (_optsOrCb as (
|
||||
err: Error | null,
|
||||
stdout: string,
|
||||
stderr: string,
|
||||
) => void)
|
||||
: _cb
|
||||
if (cb) cb(null, '', '')
|
||||
return null
|
||||
},
|
||||
)
|
||||
|
||||
// execFileSync: synchronous (returns Buffer)
|
||||
export const execFileSyncMock = mock(
|
||||
(_cmd: string, _args: string[], _opts?: unknown): Buffer => {
|
||||
return Buffer.from('')
|
||||
},
|
||||
)
|
||||
|
||||
export const childProcessMock = {
|
||||
execFile: execFileMock,
|
||||
execFileSync: execFileSyncMock,
|
||||
}
|
||||
Reference in New Issue
Block a user