Skip to content

Fix broken @stellar/stellar-sdk vitest mock — makes every PR look red #146

Closed

Description

@Miracle656

Problem

Typecheck & build fails on main with:

Error: [vitest] No "Networks" export is defined on the "@stellar/stellar-sdk" mock.
       Did you forget to return it from "vi.mock"?

Confirmed pre-existing rather than inferred: it fails identically on #137, which adds a single .md file and no code. A markdown-only PR cannot break a typecheck, so the failure is on main.

Why this matters more than one red check

Every open PR in the current batch shows a red Typecheck & build. Contributors can't tell whether they broke something, and reviewers start waving red checks through — which is exactly how a real failure eventually gets merged. A permanently-red required check is worse than no check, because it trains everyone to ignore the signal.

What to do

A vi.mock('@stellar/stellar-sdk', …) factory somewhere in the test suite returns a partial module that omits the Networks export, while some code path under test reads Networks.PUBLIC / Networks.TESTNET.

  1. Find the offending vi.mock factory.
  2. Prefer spreading the real module over hand-listing exports, so future additions don't break it again:
    vi.mock('@stellar/stellar-sdk', async (importOriginal) => ({
      ...(await importOriginal<typeof import('@stellar/stellar-sdk')>()),
      // ...only the specific overrides this test needs
    }))
    Hand-maintained partial mocks of a large SDK re-break on every upgrade; importOriginal doesn't.
  3. Confirm npm test is green on a clean main before closing.

Acceptance criteria

  • npm test passes on main with no @stellar/stellar-sdk mock errors
  • Typecheck & build is green on a freshly-opened PR
  • Any remaining partial mocks of @stellar/stellar-sdk use importOriginal spreading rather than a hand-listed export set

Drips Wave · Complexity: Easy · 100 points

Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

  1. added a commit that references this issue on Aug 30, 2026
  2. GiftedGiftB commented on Aug 30, 2026

    @GiftedGiftB

    @GiftedGiftB has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I can get this work done in less than 30 minutes.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @GiftedGiftB to this issue.

  3. macsonfleek commented on Aug 30, 2026

    @macsonfleek

    @macsonfleek has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi Maintainer, please assign me to this issue I would like to work on it.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @macsonfleek to this issue.

  4. Gbolahan088 commented on Aug 30, 2026

    @Gbolahan088

    @Gbolahan088 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello Maintainer, I would love to pick up this issue. With my extensive backend development experience across various frameworks, I'm confident I can resolve this efficiently. Looking forward to getting started

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Gbolahan088 to this issue.

  5. Ayodele06 commented on Aug 30, 2026

    @Ayodele06

    @Ayodele06 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Assign me to this issue, I will fix it as soon as possible

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ayodele06 to this issue.

  6. ghubmixxer commented on Aug 30, 2026

    @ghubmixxer

    @ghubmixxer has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I would like to work on this issue, please assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ghubmixxer to this issue.

  7. Sureplus30 commented on Aug 30, 2026

    @Sureplus30

    @Sureplus30 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I would like to work on this kindly assign me to this one issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Sureplus30 to this issue.

  8. therealbibson commented on Sep 23, 2026

    @therealbibson
    Contributor

    @therealbibson has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello! This issue matches my skill set well and I’m confident I can resolve it. Please assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @therealbibson to this issue.

  9. drips-wave commented on Sep 23, 2026

    @drips-wave

    Congratulations, @therealbibson! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @therealbibson: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  10. Miracle656 commented on Sep 24, 2026

    @Miracle656
    CollaboratorAuthor

    Closing as already fixed. Commits 041c2fc and 7e2716a added an explicit Networks: { PUBLIC, TESTNET } override to bestRoute.test.ts and aggregator.property.test.ts, and the described failure no longer reproduces: fourteen consecutive full runs on main give Tests 400 passed | 1 skipped (401) with tsc --noEmit clean.

    Leaving this open was costing real contributor effort — PR #158 was written against it. Apologies to anyone who picked it up.

    #151 is a different matter and is still real. I reproduced it three times, always in a full run, always passing in isolation, with rotating victims. An earlier check of mine got seven green runs and wrongly concluded it was fixed; that was luck, not evidence.

  11. drips-wave commented on Sep 24, 2026

    @drips-wave

    This issue has been completed by @therealbibson as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @therealbibson: You earned 100 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdifficulty:easy~1-3 hourshelp wantedExtra attention is neededpoints:100Easy tier — 100 Wave points

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions