Sfoglia il codice sorgente

test(subprocess): type Linux exec mock

pku-xht 1 mese fa
parent
commit
635c35991c

+ 3 - 1
packages/subprocess/subprocess-local/tests/spawn-runner.spec.ts

@@ -409,7 +409,9 @@ describe('Linux one-shot exec bootstrap', () => {
     const files = track(createLinuxLaunchFiles({ cwd: 'work', env: { PATH: 'bin:' } }))
     const host = new FakeRunnerHost()
     host.directory = '/base'
-    const execve = vi.fn(() => { throw Object.assign(new Error('not found'), { code: 'ENOENT' }) })
+    const execve = vi.fn((_file: string, _argv: string[], _env: Record<string, string>): never => {
+      throw Object.assign(new Error('not found'), { code: 'ENOENT' })
+    })
     await runSpawnRunner(files.requestPath, ['--', 'tool'], hostArgument(host), internals({ execve }))
     expect(host.directory).toBe('/base/work')
     expect(execve.mock.calls.map(call => call[0])).toEqual([