Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | /** |
| 2 | * OpenAI v7 + Zod v4 compatibility e2e test |
| 3 | * |
| 4 | * Verifies that packed @composio/core and @composio/openai packages install, |
| 5 | * typecheck, and run with openai@7 and zod@4. |
| 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 | // npm install inside Docker needs more time than the default TIMEOUTS.FIXTURE (120s) |
| 18 | beforeAll(async () => { |
| 19 | result = await runFixture({ |
| 20 | filename: 'index.mjs', |
| 21 | setup: 'npm run install:composio && npm run typecheck', |
| 22 | }); |
| 23 | }, 300_000); |
| 24 | |
| 25 | describe('setup', () => { |
| 26 | it('installs and typechecks successfully', () => { |
| 27 | expect(result.setup.exitCode).toBe(0); |
| 28 | expect(result.setup.stdout).toContain('openai v7 compatibility typecheck passed'); |
| 29 | }); |
| 30 | }); |
| 31 | |
| 32 | describe('OpenAI v7 + Zod v4 compatibility', () => { |
| 33 | it('exits successfully', () => { |
| 34 | expect(result.exitCode).toBe(0); |
| 35 | }); |
| 36 | |
| 37 | it('zod@4 works', () => { |
| 38 | expect(result.stdout).toContain('zod@4 works'); |
| 39 | }); |
| 40 | |
| 41 | it('openai@7 works', () => { |
| 42 | expect(result.stdout).toContain('openai@7 works'); |
| 43 | }); |
| 44 | |
| 45 | it('@composio/core works', () => { |
| 46 | expect(result.stdout).toContain('@composio/core works'); |
| 47 | }); |
| 48 | |
| 49 | it('wrapTool works', () => { |
| 50 | expect(result.stdout).toContain('core wrapTool works'); |
| 51 | expect(result.stdout).toContain('responses wrapTool works'); |
| 52 | }); |
| 53 | |
| 54 | it('all packages work together', () => { |
| 55 | expect(result.stdout).toContain('All packages work together!'); |
| 56 | }); |
| 57 | }); |
| 58 | }, |
| 59 | }); |