(path: string, cb: (err: unknown, absPath: string) => void)
| 51 | // Only stub the SFTP methods used by the tests below. |
| 52 | const sftp = { |
| 53 | realpath(path: string, cb: (err: unknown, absPath: string) => void): void { |
| 54 | state.calls.push({ method: 'realpath', path }); |
| 55 | // Mock realpath: if path is already absolute, echo it. |
| 56 | // Otherwise it would be relative — but since SSHKaos always |
| 57 | // resolves first, we should never see a relative input here. |
| 58 | cb(null, path); |
| 59 | }, |
| 60 | stat(path: string, cb: (err: unknown, stats: SFTPStats) => void): void { |
| 61 | state.calls.push({ method: 'stat', path }); |
| 62 | if (state.dirs.has(path)) { |
no test coverage detected