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
| 1 | /** |
| 2 | * @composio/vercel + AI SDK v7 compatibility e2e test. |
| 3 | * |
| 4 | * Verifies that @composio/vercel installs, typechecks, and executes wrapped |
| 5 | * tools with ai@7. |
| 6 | */ |
| 7 | |
| 8 | import { e2e, type E2ETestResultWithSetup } from '@e2e-tests/utils'; |
| 9 | import { describe, it, expect, beforeAll } from 'bun:test'; |
| 10 | |
| 11 | e2e(import.meta.url, { |
| 12 | versions: { node: ['22.23.5', '24.22.3', '26.13.1'] }, |
| 13 | usesFixtures: true, |
| 14 | defineTests: ({ runFixture }) => { |
| 15 | let result: E2ETestResultWithSetup; |
| 16 | |
| 17 | beforeAll(async () => { |
| 18 | result = await runFixture({ |
| 19 | filename: 'index.mjs', |
| 20 | // `install:vercel` packs and installs the provider tarball, which reifies |
| 21 | // the full fixture dependency tree, so no separate `npm install` is needed. |
| 22 | setup: 'npm run install:vercel && npm run typecheck', |
| 23 | }); |
| 24 | }, 300_000); |
| 25 | |
| 26 | describe('setup', () => { |
| 27 | it('installs and typechecks successfully', () => { |
| 28 | expect(result.setup.exitCode).toBe(0); |
| 29 | expect(result.setup.stdout).toContain('vercel ai sdk compatibility typecheck passed'); |
| 30 | }); |
| 31 | }); |
| 32 | |
| 33 | describe('@composio/vercel + ai@7', () => { |
| 34 | it('exits successfully', () => { |
| 35 | expect(result.exitCode).toBe(0); |
| 36 | }); |
| 37 | |
| 38 | it('wraps tools using inputSchema', () => { |
| 39 | expect(result.stdout).toContain('WRAPPED_TOOL_INPUT_SCHEMA_OK'); |
| 40 | }); |
| 41 | |
| 42 | it('executes object inputs', () => { |
| 43 | expect(result.stdout).toContain('OBJECT_INPUT_EXECUTION_OK'); |
| 44 | }); |
| 45 | |
| 46 | it('normalizes JSON string inputs', () => { |
| 47 | expect(result.stdout).toContain('STRING_INPUT_EXECUTION_OK'); |
| 48 | }); |
| 49 | |
| 50 | it('accepts AI SDK v7 execution options', () => { |
| 51 | expect(result.stdout).toContain('V7_EXECUTION_OPTIONS_OK'); |
| 52 | }); |
| 53 | |
| 54 | it('sends the source schema and validates with Zod', () => { |
| 55 | expect(result.stdout).toContain('SOURCE_SCHEMA_OK'); |
| 56 | }); |
| 57 | |
| 58 | it('produces a ToolSet-compatible collection', () => { |
| 59 | expect(result.stdout).toContain('TOOL_SET_OK'); |
| 60 | }); |
| 61 | }); |
| 62 | }, |
| 63 | }); |