@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 24 lines 915 Bytes
Raw
1 import { it } from 'vitest';
2
3 import type { Builder } from './builders';
4
5 /**
6 * Cases one builder is known to get wrong. Each entry turns the named case
7 * into a test that must keep failing for that builder, so a fix shows up as
8 * a failing suite and the entry is removed. The target is an empty list.
9 */
10 export type Divergence = {
11 readonly builder: Builder['name'];
12 /** The test name as the suite registers it. */
13 readonly case: string;
14 readonly reason: string;
15 };
16
17 export const divergences: ReadonlyArray<Divergence> = [];
18
19 const isDivergent = (builder: Builder, caseName: string): boolean =>
20 divergences.some(entry => entry.builder === builder.name && entry.case === caseName);
21
22 /** `it`, or `it.fails` for a case the builder is listed as diverging on. */
23 export const testFor = (builder: Builder, caseName: string): typeof it | typeof it.fails =>
24 isDivergent(builder, caseName) ? it.fails : it;