Repository navigation
chore(stellar): extend the shared jest config - #344
Merged
Merged
Conversation
Battambang
force-pushed
the
chore/stellar-wallet-snap-jest-config
branch
2 times, most recently
from
September 22, 2026 07:56
99fe6a9 to
be4fa7e
Compare
Battambang
marked this pull request as ready for review
September 22, 2026 08:31
Replaces the standalone config with one that inherits from jest.config.packages.js, so the package stops re-declaring coverage scope, provider, reporters and the common ignore pattern. The eight package-specific coveragePathIgnorePatterns entries, the coverage thresholds and the stellar-sdk transformIgnorePatterns are preserved unchanged.
Battambang
force-pushed
the
chore/stellar-wallet-snap-jest-config
branch
from
September 22, 2026 13:01
be4fa7e to
6f2c74d
Compare
Spread the shared ignore list instead of replacing it, so Stellar keeps the base index.ts and jest.setup.ts entries and only adds its package-specific exclusions.
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain.
Review effort: Lite
Findings: None
What changed in this PR
Updates Stellar’s Jest configuration to extend the shared package configuration while preserving Stellar-specific settings.
Changes:
- Inherits shared setup, mappings, coverage defaults, and mock behavior.
- Preserves Stellar-specific transforms, exclusions, thresholds, and test matching.
- Composes shared and Stellar test setup files.
| File | Description |
|---|---|
packages/stellar-wallet-snap/jest.config.js |
Extends the shared Jest configuration with Stellar-specific overrides. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Stellar's
jest.config.jswas a standalone configuration: it duplicated every setting instead of extending the repo-widejest.config.packages.js. That made it drift from the other snap packages and, more importantly, it never inheritedthe shared test environment setup.
This PR makes Stellar extend the shared base config, keeping only the package-specific overrides. It is the last of the per-package PRs following the base fix in #334.
What changed
packages/stellar-wallet-snap/jest.config.jsnow doesrequire('../../jest.config.packages')and spreads it.collectCoverage,collectCoverageFrom(base uses the equivalent./src/**/*.{ts,tsx}),coverageDirectory,coverageProvider,coverageReporters,resetMocks,restoreMocks.setupFilesAfterEnvnow composes[...baseConfig.setupFilesAfterEnv, '<rootDir>/jest.setup.ts']instead ofreplacing the base list, so Stellar's own setup is preserved and the shared setup runs.
moduleNameMappernow spreadsbaseConfig.moduleNameMapperbefore adding the\.svg$stub, so base mappings apply to Stellar.preset: '@metamask/snaps-jest',transform(ts-jest),testMatch, the broadcoveragePathIgnorePatternslist, andcoverageThreshold.Behavioral impact
setupFiles(tests/setup.ts) andsetupFilesAfterEnv(tests/setupAfterEnv/index.ts), including the sharednocknetwork isolation. Previously Stellar ran without any of it. All tests still pass, so the suite has no external-network dependency.testEnvironmenttonode, so the@metamask/snaps-jestpreset's environment is used..tsand.tsx, coverage is byte-identical before and after (statements 85.67%, branches 70.77%, functions 79.82%, lines 85.63%).Manual testing steps
Routine config change; verification is automated:
yarn workspace @metamask/stellar-wallet-snap run buildyarn workspace @metamask/stellar-wallet-snap run testyarn workspace @metamask/stellar-wallet-snap run test --coverageyarn lint:tscChecklist
eslint,prettier,lint:tsc)Related to WPN-815.
Stacked on #334 (merged).