@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 57 lines 1.71 KB
Raw
1 import { describe, it } from '@effect/vitest';
2 import { deepStrictEqual } from '@effect/vitest/utils';
3 import { Config, ConfigProvider, Effect } from 'effect';
4 import { DEBUG_CONFIG } from 'src/config';
5
6 const read = (env: Record<string, string>) =>
7 Config.all(DEBUG_CONFIG).parse(ConfigProvider.fromEnvRecord(env));
8
9 describe('DEBUG_CONFIG', () => {
10 it.effect('[Given] an empty environment [Then] every toggle is off', () =>
11 Effect.gen(function* () {
12 deepStrictEqual(yield* read({}), {
13 PERF_DEBUG: false,
14 TOOL_DEBUG: false,
15 TELEMETRY_DEBUG: false,
16 UPGRADE_TARGET: undefined,
17 VERSION: undefined,
18 FORCE_USE_CACHE: false,
19 });
20 })
21 );
22
23 it.effect('[Given] misspelled override names [Then] they are ignored', () =>
24 Effect.gen(function* () {
25 const actual = yield* read({
26 COMPOSIO_UPGRADE_TARGET: 'x',
27 COMPOSIO_DEBUG_OVERRIDE_VERSION: 'x',
28 UPGRADE_TARGET: 'x',
29 });
30 deepStrictEqual(actual.UPGRADE_TARGET, undefined);
31 deepStrictEqual(actual.VERSION, undefined);
32 })
33 );
34
35 it.effect('[Given] every variable [Then] values are read as written', () =>
36 Effect.gen(function* () {
37 deepStrictEqual(
38 yield* read({
39 COMPOSIO_PERF_DEBUG: '1',
40 COMPOSIO_TOOL_DEBUG: 'true',
41 COMPOSIO_CLI_TELEMETRY_DEBUG: 'yes',
42 DEBUG_OVERRIDE_UPGRADE_TARGET: './composio',
43 DEBUG_OVERRIDE_VERSION: '9.9.9',
44 FORCE_USE_CACHE: 'true',
45 }),
46 {
47 PERF_DEBUG: true,
48 TOOL_DEBUG: true,
49 TELEMETRY_DEBUG: true,
50 UPGRADE_TARGET: './composio',
51 VERSION: '9.9.9',
52 FORCE_USE_CACHE: true,
53 }
54 );
55 })
56 );
57 });