Skip to content

Feat/issue 93 runtime compat#148

Open
Oluwasuyi-Oluwatimilehin-Daniel wants to merge 3 commits into
Adamantine-guild:mainfrom
Oluwasuyi-Oluwatimilehin-Daniel:feat/issue-93-runtime-compat
Open

Feat/issue 93 runtime compat#148
Oluwasuyi-Oluwatimilehin-Daniel wants to merge 3 commits into
Adamantine-guild:mainfrom
Oluwasuyi-Oluwatimilehin-Daniel:feat/issue-93-runtime-compat

Conversation

@Oluwasuyi-Oluwatimilehin-Daniel

Copy link
Copy Markdown

#closes #93

Summary

Addresses #93 by setting up a dedicated multi-runtime verification matrix using Vitest Workspaces. This guarantees the universal SDK claim remains functional and prevents Node-only globals or modules from creeping into browser/edge contexts.

What Changed?

  • Vitest Configuration: Separated core test parameters out into a new vitest.workspace.ts file.
  • Environment Matrix: Configured three isolated test workspaces:
    • node: Handles standard package unit tests (excludes compat folders).
    • browser: Uses jsdom to verify execution inside standard web browsers.
    • edge: Leverages vitest-environment-edge-runtime to mirror V8 engine restrictions (Cloudflare Workers/Vercel Edge).
  • Test Implementation: Added tests/compat/browser/browser.test.ts and tests/compat/edge/edge.test.ts to test client initialization and custom fetch execution paths under isolated constraints.
  • CI Workflow Update: Integrated pnpm test:run directly into the .github/workflows/ci.yml file to block broken code architectures at the gate.

Acceptance Criteria Verification

  • Compatibility tests execute successfully in a Node runtime environment.
  • Compatibility tests execute successfully in a browser-like (jsdom) runtime environment.
  • Compatibility tests cover a custom fetch mock/transport.
  • SDK imports do not throw errors or demand Node-only globals in browser-like environments.
  • CI pipeline successfully running all suites prior to public API serialization checks.

How to Test Locally

  1. Run pnpm install to grab the new edge-runtime testing utilities.
  2. Run pnpm test:run (or pnpm test).
  3. Observe all 3 project badges ([node], [browser], [edge]) reporting successful execution assertions.
    #closes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add browser and edge runtime compatibility tests

1 participant