@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, 06:00 UTC

next
ts 20 lines 784 Bytes
Raw
1 import { describe, expect, layer } from '@effect/vitest';
2 import { Effect } from 'effect';
3 import { detectMasterFromHost } from 'src/services/master-detector';
4 import { cli, MockConsole, TestLive } from 'test/__utils__';
5
6 describe('CLI: composio debug who-is-my-master', () => {
7 layer(TestLive())(it => {
8 // The host environment decides the answer, so the test reads it through the same detector.
9 it.effect('[Then] prints the detected master as indented JSON on stdout', () =>
10 Effect.gen(function* () {
11 const master = yield* detectMasterFromHost;
12 yield* cli(['debug', 'who-is-my-master']);
13
14 expect(yield* MockConsole.getLines({ stream: 'stdout' })).toEqual([
15 JSON.stringify({ master }, null, 2),
16 ]);
17 })
18 );
19 });
20 });