Skip to content

chore(bitcoin): clean up integration test suppressions - #638

Merged
ulissesferreira merged 1 commit into
mainfrom
chore/bitcoin-lint-suppressions-integration-test
Nov 17, 2026
Merged

ulissesferreira merged 1 commit into
mainfrom
chore/bitcoin-lint-suppressions-integration-test

Conversation

@ulissesferreira

Copy link
Copy Markdown
Contributor

Description

Removes the 43 Oxlint suppressions recorded for packages/bitcoin-wallet-snap/integration-test/**, so the whole directory is now lint-clean without entries in oxlint-suppressions.json. The changes are typing/hygiene only: redundant as KeyringRequest assertions are dropped (the params field already accepts the object literal), in checks become hasProperty() from @metamask/utils, return undefined fallbacks in the snap.mockJsonRpc handlers are removed (an implicit undefined is the same value), the untyped fetch JSON body in BlockchainTestUtils.getBalance is given an explicit Esplora response type, and two dead .skip tests are deleted because the behaviour they exercised is gone: confirmSend no longer produces InsufficientBalanceToCoverFee (drainWallet covers the fee) and keyring_createAccount no longer accepts P2PKH/P2SH/P2TR address types (KeyringHandler.createAccounts rejects everything but P2WPKH). No production code, lint config or rule severity was touched.

Changes

  • packages/bitcoin-wallet-snap/integration-test/blockchain-utils.ts — drop import process from 'process' (global), type the /address/:address response (n/prefer-global/process, no-shadow, typescript/no-unsafe-argument, typescript/no-unsafe-member-access)
  • packages/bitcoin-wallet-snap/integration-test/client-request.test.ts — drop the useless return undefined, use hasProperty for the JSON-RPC result guard, remove the dead it.skip fee case and the as any on the intentionally incomplete params (unicorn/no-useless-undefined, vitest/no-disabled-tests, typescript/no-explicit-any, typescript/no-unnecessary-type-assertion, internal-snaps/no-in-operator)
  • packages/bitcoin-wallet-snap/integration-test/cron-sync.test.ts — drop the useless return undefined, use hasProperty in the result assertion (unicorn/no-useless-undefined, internal-snaps/no-in-operator)
  • packages/bitcoin-wallet-snap/integration-test/keyring-request.test.ts — drop 21 redundant as KeyringRequest casts, drop the useless return undefined, use hasProperty, and assert() the first UTXO instead of reading it through an optional chain (typescript/no-unnecessary-type-assertion ×20, unicorn/no-useless-undefined, internal-snaps/no-in-operator)
  • packages/bitcoin-wallet-snap/integration-test/keyring.test.ts — replace the conditional result guards with assert(hasProperty(...)) so the setup runs unconditionally, drop the useless return undefined, delete the it.skip.each block for unsupported address types (vitest/no-conditional-in-test ×3, internal-snaps/no-in-operator ×3, unicorn/no-useless-undefined, vitest/no-disabled-tests)
  • oxlint-suppressions.json — regenerated with --prune-suppressions (5 file entries removed, 43 violations)

Quality gates

  • yarn lint:oxlint packages/bitcoin-wallet-snap — clean, 43 of 43 suppressions entries removed (2069 → 2026 total counts)
  • yarn workspace @metamask/bitcoin-wallet-snap exec tsc --project tsconfig.json --noEmit — clean
  • yarn workspace @metamask/bitcoin-wallet-snap exec vitest run — 28 files / 761 tests passed
  • oxfmt --check — clean
  • Integration suite not run locally: requires docker compose (integration-test/run-integration.sh boots bitcoind via @metamask/snaps-jest), so these files were validated with tsc + oxlint only.

@ulissesferreira
ulissesferreira requested a review from a team as a code owner November 17, 2026 02:29
@ulissesferreira
ulissesferreira requested review from a team as code owners November 17, 2026 02:29
@ulissesferreira ulissesferreira changed the title chore(bitcoin): clean up Bitcoin integration test suppressions chore(bitcoin): clean up integration test suppressions Nov 17, 2026
@ulissesferreira
ulissesferreira force-pushed the chore/bitcoin-lint-suppressions-integration-test branch from 6678571 to 1be59f9 Compare November 17, 2026 14:45
@ulissesferreira
ulissesferreira force-pushed the chore/bitcoin-lint-suppressions-integration-test branch from 1be59f9 to cb56a74 Compare November 17, 2026 14:46
@sonarqubecloud

Copy link
Copy Markdown

@taran-a taran-a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. GG

@ulissesferreira
ulissesferreira added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 39d1d13 Nov 17, 2026
57 checks passed
@ulissesferreira
ulissesferreira deleted the chore/bitcoin-lint-suppressions-integration-test branch November 17, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants