Back to Composio

Deno ESM Compatibility Test

ts/e2e-tests/runtimes/deno/esm-basic/README.md

0.11.11.8 KB
Original Source

Deno ESM Compatibility Test

Verifies that @composio/core works correctly when imported via npm: specifier in Deno.

Why This Exists

Deno v2.0+ supports npm packages via the npm: specifier. This suite ensures:

  • import('npm:@composio/core') resolves without errors
  • Named imports work
  • All public exports are accessible
  • No Node.js-only patterns break Deno consumers

What It Tests

TestDescription
Dynamic importimport('npm:@composio/core') doesn't throw
Composio classMain class is exported and constructible
OpenAIProviderProvider class exports and instantiation
AuthSchemeAuth enum is accessible
ComposioErrorError classes are exported
jsonSchemaToZodSchemaUtility function is exported
constantsConstants namespace is accessible
loggerLogger instance is exported

Fixture

fixtures/
├── deno.jsonc # Deno config to use local workspace packages
└── test.ts    # Deno test script using npm: specifier

The fixture uses Deno's native npm: specifier to import @composio/core and validates each export.

The deno.jsonc file configures nodeModulesDir: "auto", which tells Deno to resolve npm: imports from the local node_modules directory (populated by pnpm with symlinks to workspace packages). This ensures we test the local build of @composio/core rather than the published npm version.

Isolation Tool

Docker with Deno version: 2.6.7

Running

bash
pnpm test:e2e:deno