diff options
| author | Adam Malczewski <[email protected]> | 2026-06-27 01:12:40 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-27 01:12:40 +0900 |
| commit | 98b0638838a8e754927d8c030ce8bded18d63e7d (patch) | |
| tree | 0d4e21c3d4792fcd77e1040373b260e38efa34ce /packages/exec-backend/src/backend.test.ts | |
| parent | d92a4af6191d7d20acf861adf605ad0227b6b287 (diff) | |
| parent | 61e45e60d699ed1ca46f94a8f181c92a940317c6 (diff) | |
| download | dispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.tar.gz dispatch-98b0638838a8e754927d8c030ce8bded18d63e7d.zip | |
Merge branch 'dev' into feature/heartbeat
# Conflicts:
# packages/host-bin/package.json
# packages/host-bin/src/main.ts
# packages/session-orchestrator/src/orchestrator.ts
# packages/system-prompt/src/service.test.ts
# packages/system-prompt/src/service.ts
# packages/system-prompt/src/types.ts
# packages/transport-contract/package.json
# packages/transport-http/package.json
# packages/transport-http/src/app.test.ts
# packages/transport-http/src/app.ts
# packages/transport-http/src/extension.ts
# packages/transport-http/tsconfig.json
# tsconfig.json
Diffstat (limited to 'packages/exec-backend/src/backend.test.ts')
| -rw-r--r-- | packages/exec-backend/src/backend.test.ts | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/packages/exec-backend/src/backend.test.ts b/packages/exec-backend/src/backend.test.ts index 30458e7..2e454ea 100644 --- a/packages/exec-backend/src/backend.test.ts +++ b/packages/exec-backend/src/backend.test.ts @@ -6,58 +6,58 @@ import type { DirEntry, ExecBackend, ExecResult, SpawnParams, StatResult } from * (Pure compile-time + runtime check; zero internal mocks.) */ describe("ExecBackend type conformance", () => { - it("a minimal fake satisfies the ExecBackend interface", () => { - const fake: ExecBackend = { - spawn: async (_params: SpawnParams): Promise<ExecResult> => ({ - exitCode: 0, - timedOut: false, - aborted: false, - }), - readFile: async (_path: string): Promise<string> => "", - writeFile: async (_path: string, _content: string): Promise<void> => {}, - stat: async (_path: string): Promise<StatResult> => ({ isFile: true, isDirectory: false }), - readdir: async (_path: string): Promise<readonly DirEntry[]> => [], - exists: async (_path: string): Promise<boolean> => true, - }; + it("a minimal fake satisfies the ExecBackend interface", () => { + const fake: ExecBackend = { + spawn: async (_params: SpawnParams): Promise<ExecResult> => ({ + exitCode: 0, + timedOut: false, + aborted: false, + }), + readFile: async (_path: string): Promise<string> => "", + writeFile: async (_path: string, _content: string): Promise<void> => {}, + stat: async (_path: string): Promise<StatResult> => ({ isFile: true, isDirectory: false }), + readdir: async (_path: string): Promise<readonly DirEntry[]> => [], + exists: async (_path: string): Promise<boolean> => true, + }; - // Runtime sanity: every method is present and callable. - expect(typeof fake.spawn).toBe("function"); - expect(typeof fake.readFile).toBe("function"); - expect(typeof fake.writeFile).toBe("function"); - expect(typeof fake.stat).toBe("function"); - expect(typeof fake.readdir).toBe("function"); - expect(typeof fake.exists).toBe("function"); - }); + // Runtime sanity: every method is present and callable. + expect(typeof fake.spawn).toBe("function"); + expect(typeof fake.readFile).toBe("function"); + expect(typeof fake.writeFile).toBe("function"); + expect(typeof fake.stat).toBe("function"); + expect(typeof fake.readdir).toBe("function"); + expect(typeof fake.exists).toBe("function"); + }); - it("ExecResult is { exitCode, timedOut, aborted }", () => { - const result: ExecResult = { exitCode: null, timedOut: true, aborted: false }; - expect(result.exitCode).toBeNull(); - expect(result.timedOut).toBe(true); - expect(result.aborted).toBe(false); - }); + it("ExecResult is { exitCode, timedOut, aborted }", () => { + const result: ExecResult = { exitCode: null, timedOut: true, aborted: false }; + expect(result.exitCode).toBeNull(); + expect(result.timedOut).toBe(true); + expect(result.aborted).toBe(false); + }); - it("SpawnParams carries the shell-tool seam fields", () => { - const params: SpawnParams = { - command: "echo", - cwd: "/tmp", - signal: new AbortController().signal, - timeout: 1000, - onOutput: () => {}, - }; - expect(params.command).toBe("echo"); - expect(params.timeout).toBe(1000); - }); + it("SpawnParams carries the shell-tool seam fields", () => { + const params: SpawnParams = { + command: "echo", + cwd: "/tmp", + signal: new AbortController().signal, + timeout: 1000, + onOutput: () => {}, + }; + expect(params.command).toBe("echo"); + expect(params.timeout).toBe(1000); + }); - it("StatResult distinguishes file vs directory", () => { - const fileStat: StatResult = { isFile: true, isDirectory: false }; - const dirStat: StatResult = { isFile: false, isDirectory: true }; - expect(fileStat.isFile && !fileStat.isDirectory).toBe(true); - expect(!dirStat.isFile && dirStat.isDirectory).toBe(true); - }); + it("StatResult distinguishes file vs directory", () => { + const fileStat: StatResult = { isFile: true, isDirectory: false }; + const dirStat: StatResult = { isFile: false, isDirectory: true }; + expect(fileStat.isFile && !fileStat.isDirectory).toBe(true); + expect(!dirStat.isFile && dirStat.isDirectory).toBe(true); + }); - it("DirEntry carries name + isDirectory", () => { - const entry: DirEntry = { name: "sub", isDirectory: true }; - expect(entry.name).toBe("sub"); - expect(entry.isDirectory).toBe(true); - }); + it("DirEntry carries name + isDirectory", () => { + const entry: DirEntry = { name: "sub", isDirectory: true }; + expect(entry.name).toBe("sub"); + expect(entry.isDirectory).toBe(true); + }); }); |
