MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeFakeInstance

Function makeFakeInstance

packages/kaos/test/ssh.test.ts:380–388  ·  view source on GitHub ↗
(sftp: unknown, cwd: string)

Source from the content-addressed store, hash-verified

378 }
379
380 function makeFakeInstance(sftp: unknown, cwd: string): SSHKaos {
381 // Bypass the real constructor (which requires a live ssh2 client) and
382 // populate just the private fields that chdir touches.
383 const instance = Object.create(SSHKaos.prototype) as SSHKaos;
384 const internal = instance as unknown as { _sftp: unknown; _cwd: string };
385 internal._sftp = sftp;
386 internal._cwd = cwd;
387 return instance;
388 }
389
390 it('rejects a target that resolves to a regular file', async () => {
391 const target = '/tmp/not-a-dir.txt';

Callers 1

ssh.test.tsFile · 0.85

Calls 1

createMethod · 0.65

Tested by

no test coverage detected