Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs(e2e): update examples and TIMEOUTS table for FIXTURE constant

jkomyno1d2ee8f18ade
diff --git a/ts/e2e-tests/README.md b/ts/e2e-tests/README.md
index 19ba2d222..643a6b9a0 100644
--- a/ts/e2e-tests/README.md
+++ b/ts/e2e-tests/README.md
@@ -94,6 +94,7 @@ pnpm test:e2e:cloudflare
```typescript
import { e2e, type E2ETestResult } from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
import { describe, it, expect, beforeAll } from 'bun:test';
e2e(import.meta.url, {
@@ -106,7 +107,7 @@ e2e(import.meta.url, {
beforeAll(async () => {
result = await runFixture({ filename: 'fixtures/test.mjs' });
- });
+ }, TIMEOUTS.FIXTURE);
describe('output', () => {
it('exits successfully', () => {
@@ -132,6 +133,7 @@ e2e(import.meta.url, {
```typescript
import { e2e, type E2ETestResult } from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
import { describe, it, expect, beforeAll } from 'bun:test';
e2e(import.meta.url, {
@@ -144,7 +146,7 @@ e2e(import.meta.url, {
beforeAll(async () => {
result = await runFixture({ filename: 'test.ts' });
- });
+ }, TIMEOUTS.FIXTURE);
describe('output', () => {
it('exits successfully', () => {
@@ -167,6 +169,7 @@ For tests that need to install npm packages at runtime, use `usesFixtures: true`
```typescript
import { e2e, type E2ETestResultWithSetup } from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
import { describe, it, expect, beforeAll } from 'bun:test';
e2e(import.meta.url, {
@@ -181,7 +184,7 @@ e2e(import.meta.url, {
filename: 'index.mjs',
setup: 'npm install --legacy-peer-deps', // Runs before fixture
});
- });
+ }, TIMEOUTS.FIXTURE);
describe('setup', () => {
it('npm install completes successfully', () => {
diff --git a/ts/e2e-tests/_utils/README.md b/ts/e2e-tests/_utils/README.md
index e74986ac9..d6dffeef7 100644
--- a/ts/e2e-tests/_utils/README.md
+++ b/ts/e2e-tests/_utils/README.md
@@ -19,6 +19,7 @@ The main entry point for e2e tests. Automatically infers the working directory a
```typescript
import { e2e, type E2ETestResult } from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
import { describe, it, expect, beforeAll } from 'bun:test';
e2e(import.meta.url, {
@@ -32,7 +33,7 @@ e2e(import.meta.url, {
beforeAll(async () => {
result = await runFixture({ filename: 'fixtures/test.mjs' });
- });
+ }, TIMEOUTS.FIXTURE);
describe('output', () => {
it('exits successfully', () => {
@@ -148,11 +149,12 @@ it('calls LLM', async () => {
}, { timeout: TIMEOUTS.LLM_SHORT });
```
-| Constant | Value | Use Case |
-| ----------- | --------- | ---------------------------------- |
-| `DEFAULT` | `5_000` | Standard test operations |
-| `LLM_SHORT` | `15_000` | Quick LLM calls |
-| `LLM_LONG` | `60_000` | Complex LLM operations |
+| Constant | Value | Use Case |
+| ----------- | --------- | ------------------------------------------ |
+| `DEFAULT` | `5_000` | Standard test operations |
+| `FIXTURE` | `15_000` | `beforeAll` hooks that call `runFixture()` |
+| `LLM_SHORT` | `30_000` | Quick LLM calls |
+| `LLM_LONG` | `60_000` | Complex LLM operations |
## Version Resolution
@@ -210,6 +212,8 @@ When `usesFixtures: true` is set:
Use this for tests that have their own `package.json` and need to run `npm install`:
```typescript
+import { TIMEOUTS } from '@e2e-tests/utils/const';
+
e2e(import.meta.url, {
usesFixtures: true,
defineTests: ({ runFixture }) => {
@@ -219,7 +223,7 @@ e2e(import.meta.url, {
filename: 'index.mjs', // Resolves to fixtures/index.mjs
setup: 'npm install', // Runs in fixtures/
});
- });
+ }, TIMEOUTS.FIXTURE);
},
});
```
diff --git a/ts/e2e-tests/_utils/src/e2e.ts b/ts/e2e-tests/_utils/src/e2e.ts
index 04c0007ca..48ed982c8 100644
--- a/ts/e2e-tests/_utils/src/e2e.ts
+++ b/ts/e2e-tests/_utils/src/e2e.ts
@@ -58,8 +58,8 @@ function inferCwd(importMetaUrl: string, repoRoot: string): string {
* let result: E2ETestResult;
*
* beforeAll(async () => {
- * result = await runFixture('fixtures/test.mjs');
- * }, 300_000);
+ * result = await runFixture({ filename: 'fixtures/test.mjs' });
+ * }, TIMEOUTS.FIXTURE);
*
* describe('output', () => {
* it('exits successfully', () => {
diff --git a/ts/e2e-tests/_utils/src/types.ts b/ts/e2e-tests/_utils/src/types.ts
index 8b217684b..fa6a1f3b7 100644
--- a/ts/e2e-tests/_utils/src/types.ts
+++ b/ts/e2e-tests/_utils/src/types.ts
@@ -174,7 +174,7 @@ export interface E2EConfig {
*
* beforeAll(async () => {
* result = await runFixture({ filename: 'fixtures/test.mjs' });
- * }, 300_000);
+ * }, TIMEOUTS.FIXTURE);
*
* describe('output', () => {
* it('exits successfully', () => {