Skip to content

fix(test): make the test suites typecheck - #1652

Merged
quietbits merged 1 commit into
mainfrom
fix-test-type-errors
Aug 14, 2026
Merged

fix(test): make the test suites typecheck#1652
quietbits merged 1 commit into
mainfrom
fix-test-type-errors

Conversation

@quietbits

Copy link
Copy Markdown
Contributor
  • Fixed test/tsconfig.json, which had been typechecking nothing — its vitest/globals entry could not resolve under the config's own typeRoots, so tsc reported a single TS2688 and silently skipped all 130 files it had loaded
  • Fixed 107 type errors across 38 test files, mostly union narrowing through the existing expectVariant and expectDefined helpers, .js extensions on relative imports, and branded XDR byte types (ContractId/PoolId where Hash was being passed)
  • Aligned the test config with the build config — enabled noImplicitAny, dropped exactOptionalPropertyTypes, set importHelpers: false — clearing 33 errors reported against src/** that build:types never produces
  • Added a typecheck:tests script and chained it into test
  • Replaced the single _.isMatch call in the apiary integration test with toMatchObject and arrayContaining, and dropped the now-unused lodash devDependency
  • Removed a "raw" format argument in strkey.test.ts that matches no fromXdr overload and is discarded at runtime

Copilot AI balanced review requested due to automatic review settings August 14, 2026 20:38
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Restores TypeScript checking for test suites and resolves resulting type errors.

Changes:

  • Fixes test TypeScript configuration and adds typecheck:tests.
  • Adds union narrowing, branded XDR types, and explicit .js imports.
  • Replaces Lodash matching with Vitest matchers and removes Lodash.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/xdr/schema_exhaustive.test.ts Uses public XDR type export; removes unused variable.
test/unit/utils.test.ts Removes unused import.
test/unit/spec/event_spec.test.ts Narrows decoded event topic variant.
test/unit/spec/contract_spec.test.ts Adds safe XDR map/value narrowing.
test/unit/server/soroban/simulate_transaction.test.ts Fixes imports and XDR typing.
test/unit/server/soroban/send_transaction.test.ts Adds .js import extension.
test/unit/server/soroban/query_contract.test.ts Adds .js import extension.
test/unit/server/soroban/get_version_info.test.ts Adds .js import extension.
test/unit/server/soroban/get_transactions.test.ts Adds .js import extension.
test/unit/server/soroban/get_transaction.test.ts Fixes import and removes unused XDR binding.
test/unit/server/soroban/get_network.test.ts Adds .js import extension.
test/unit/server/soroban/get_ledger_entries.test.ts Adds .js import extension.
test/unit/server/soroban/get_latest_ledger.test.ts Adds .js import extension.
test/unit/server/soroban/get_health.test.ts Adds .js import extension.
test/unit/server/soroban/get_fee_stats.test.ts Adds .js import extension.
test/unit/server/soroban/get_events.test.ts Adds .js import extension.
test/unit/server/soroban/get_contract_wasm.test.ts Uses directly typed XDR imports.
test/unit/server/soroban/get_contract_methods.test.ts Uses directly typed XDR imports.
test/unit/server/soroban/get_contract_data.test.ts Adds .js import extension.
test/unit/server/soroban/get_classic_entries.test.ts Fixes import and unused parameter.
test/unit/server/soroban/get_account.test.ts Adds .js import extension.
test/unit/server/soroban/constructor.test.ts Adds .js import extension.
test/unit/server/soroban/assembled_transaction.test.ts Narrows unions and corrects string arguments.
test/unit/server_async_transaction.test.ts Removes unused import.
test/unit/guide-snippets.test.ts Adds .js import extension.
test/unit/contract/client_from.test.ts Adds .js import extension.
test/unit/base/transaction.test.ts Removes unused types and type-safe mutation casts.
test/unit/base/strkey.test.ts Removes unsupported XDR format argument.
test/unit/base/scval.test.ts Adds safe ScVal narrowing.
test/unit/base/operations/set_options.test.ts Narrows parsed signer hashes to bytes.
test/unit/base/numbers/xdr_large_int.test.ts Removes unused import.
test/unit/base/muxed_account.test.ts Removes unused import.
test/unit/base/events.test.ts Uses branded contract identifiers.
test/unit/base/auth.test.ts Narrows authorization credential variants.
test/unit/base/address.test.ts Uses branded contract and pool identifiers.
test/tsconfig.json Enables effective test-suite typechecking.
test/integration/bindings.test.ts Removes unused import.
test/integration/apiary.test.ts Replaces Lodash matching with Vitest.
pnpm-lock.yaml Removes direct Lodash lock entries.
package.json Adds test typecheck script and removes Lodash.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
Comment thread test/tsconfig.json
@quietbits
quietbits merged commit 38a1932 into main Aug 14, 2026
23 of 24 checks passed
@quietbits
quietbits deleted the fix-test-type-errors branch August 14, 2026 20:54
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants