@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
ts 22 lines 796 Bytes
Raw
1 import { describe, expect, it } from '@effect/vitest';
2 import { Effect } from 'effect';
3 import { DetachedProcessSpawnError, spawnDetached } from 'src/services/detached-process';
4
5 describe('spawnDetached', () => {
6 it.effect('fails when the executable does not exist', () =>
7 Effect.gen(function* () {
8 const command = '__composio_missing_detached_process__';
9 const error = yield* spawnDetached(command, []).pipe(Effect.flip);
10
11 expect(error).toBeInstanceOf(DetachedProcessSpawnError);
12 expect(error.command).toBe(command);
13 expect(String(error.cause)).toContain('ENOENT');
14 })
15 );
16
17 it.effect('succeeds after the child process spawns', () =>
18 Effect.gen(function* () {
19 yield* spawnDetached(process.execPath, ['-e', 'process.exit(0)']);
20 })
21 );
22 });