Skip to content

feat(snaps-vitest): scaffold package - #4174

Open
ulissesferreira wants to merge 1 commit into
mainfrom
feat/snaps-vitest-package
Open

ulissesferreira wants to merge 1 commit into
mainfrom
feat/snaps-vitest-package

Conversation

@ulissesferreira

Copy link
Copy Markdown

Summary

Scaffolds a new @metamask/snaps-vitest package in the monorepo. This is the first PR in a stack; the full implementation lands in the follow-up PR.

packages/snaps-vitest/
├── package.json       # dual ESM/CJS exports for index, environment, setup, config
├── tsconfig.json      # references snaps-controllers, snaps-sdk, snaps-simulation, snaps-utils
├── tsconfig.build.json
├── vitest.config.mts
├── src/
│   ├── index.ts
│   ├── config.ts      # snapsVitestPreset and getSnapsVitestConfig
│   └── config.test.ts
├── CHANGELOG.md
├── LICENSE
└── README.md

Wiring changes:

 tsconfig.json            # add package project reference
 tsconfig.build.json      # add package build reference
 eslint.config.mjs        # treat package src as Node.js source
 yarn.config.cjs          # allow Vitest test scripts instead of the shared Jest scripts
 README.md                # generated package list / dependency graph
 yarn.lock

The package supports Vitest ^3.1.1, matching the version already used in the monorepo. getSnapsVitestConfig sets the production Snaps JSX runtime through Vite's esbuild options.

Evidence

  • Before: no @metamask/snaps-vitest workspace.
    After: yarn workspace @metamask/snaps-vitest run build, lint, and test pass; yarn constraints and yarn lint:tsconfig pass.

Merge Danger

Door: two-way

Blast Radius: low

New workspace only. Build, lint, and test scripts are additive; the only shared-file changes are project references and the Vitest test-script exception.

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.69%. Comparing base (20c55c4) to head (7ee7176).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4174   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files         429      429           
  Lines       12533    12533           
  Branches     1986     1986           
=======================================
  Hits        12369    12369           
  Misses        164      164           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ulissesferreira
ulissesferreira marked this pull request as ready for review November 5, 2026 21:22
@ulissesferreira
ulissesferreira requested a review from a team as a code owner November 5, 2026 21:22
@ulissesferreira
ulissesferreira force-pushed the feat/snaps-vitest-package branch from 8d8c301 to 7ee7176 Compare November 6, 2026 09:45

This branch has not been deployed

No deployments
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.

1 participant