You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(test): eliminate all console noise from jest CI logs at the source
Follow-up to #3816. Jest output is now completely free of console
log/debug/warn/error blocks; every source was root-fixed rather than
suppressed (full suite: 401 suites / 4526 tests passing).
Shared Apollo mocks (app/graphql/mocks.ts):
- All mocks are reusable via maxUsageCount: Infinity (replaces the
[...mocks x6] spread hack): components fire the same queries on every
mount, re-render and refetch.
- Add missing mocks: scanningQRCodeScreen, contacts, supportedCountries,
SettingsScreen, walletOverviewScreen, Bulletins, language,
notificationSettings, sendBitcoinWithdrawalLimits, realtimePriceUnauthed.
- Backfill fields the queries select but the aging mock data lacked
(me.email, pendingIncomingTransactions, preImage, paymentRequest),
fixing Apollo "Missing field" invariant errors on cache writes.
- Extract mockCurrencyList as a shared export so specs and mocks write a
consistent Query.currencyList (avoids cache-replacement warnings).
"No more mocked responses" (260+ -> 0, no suppression):
- home.spec / transaction-history-screen.spec: the @app/graphql/mocks
module replacement now backfills with the actual shared mocks (local
mocks first and infinite-use, so they keep precedence).
- send-bitcoin-completed-screen.stories: pass shared mocks to the
stories' MockedProviders instead of [].
- use-show-warning-secure-account.spec: reusable local mocks + missing
displayCurrency mock.
"Maximum update depth exceeded" (4 -> 0):
- use-payment-request.spec: mutation hook mocks returned a fresh
jest.fn() per render, invalidating the mutations memo and re-running
useInvoiceLifecycle's layout effect every render. Stable fns now.
- use-invoice-lifecycle.spec: inline prcd object literals changed
identity every render, ping-ponging the layout effect against the
hash-paid effect. Hoisted to a stable const.
- The unmasked async generateRequest updates are settled with
flushEffects() (pattern from #3820).
Expected error/log output is now captured and asserted instead of
printed (a logged-but-expected error is indistinguishable from a real
failure in CI logs):
- use-kyc-flow.spec, use-lnurl-withdraw.spec,
network-error-component.spec: console.error/debug spies with
assertions on the expected message.
- receive.spec: decodeInvoiceString mocked to return no expiry instead
of throwing on the intentionally fake invoice fixtures (27 bolt11
"Invalid checksum" errors); nfc-manager mock extended with
requestTechnology/getTag/cancelTechnologyRequest since ModalNfc's init
path now runs.
- lazy-locale-loader.test, card-status-screen.spec,
card-subscription-screen.spec, receive.spec: console.log spies for
app placeholder/diagnostic logs.
jest.setup.js CI suppression gains only the SafeAreaView deprecation
warning (react-native-country-picker-modal), alongside the existing
InteractionManager one.
Also fixes latent spec bugs surfaced by the now-resolving queries:
missing feeReimbursementMemo in home.spec's remote-config mock and
missing homeAuthed user fields (language/username/phone/email).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments