Skip to content

test: add unit tests for indexing-client and viem-extension#42

Merged
Skanislav merged 2 commits into
devfrom
test/indexing-client-viem-extension
Apr 13, 2026
Merged

test: add unit tests for indexing-client and viem-extension#42
Skanislav merged 2 commits into
devfrom
test/indexing-client-viem-extension

Conversation

@Skanislav

Copy link
Copy Markdown
Contributor

Summary

  • 42 tests for @hollab-io/indexing-client — covers every query method on createIndexingClient: response unwrapping, pagination forwarding, and address lowercasing invariants (creator, registryAddress, memberAddress)
  • 29 tests for @hollab-io/viem-extension — covers all 6 selectors (createPartnerMap, createCircleMap, createRoleMap, getAnchorCircle, getSubCircles, getRolesForCircle) against both minimal fixtures and the full mock snapshot

Also fixes test infrastructure for both packages:

  • Add paths: { "@/*": ["./src/*"] } + test/**/* to each package tsconfig so ESLint resolves @/ imports in test files
  • Add packages/indexing-client/.eslintrc.cjs so ESLint uses the local tsconfig (the root tsconfig has no path aliases)

Test plan

  • pnpm --filter @hollab-io/indexing-client test → 42 passed
  • pnpm --filter @hollab-io/viem-extension test → 29 passed
  • pnpm --filter @hollab-io/indexing-client lint → 0 errors
  • pnpm --filter @hollab-io/viem-extension lint → 0 errors
  • pnpm check-types → all packages pass

🤖 Generated with Claude Code

Skanislav and others added 2 commits April 13, 2026 18:31
…ent and selectors

42 tests for createIndexingClient covering all query methods, response
unwrapping, pagination forwarding, and address lowercasing invariants.
29 tests for viem-extension selectors (createPartnerMap, createCircleMap,
createRoleMap, getAnchorCircle, getSubCircles, getRolesForCircle) against
both minimal fixtures and the full mock snapshot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…est files

Add package-level tsconfig path alias (@/* → src/*) and test/** include so
TypeScript resolves @/ imports in test files. Add .eslintrc.cjs to
indexing-client to use its local tsconfig (ESLint was using the root tsconfig
which has no paths configured). Switch indexing-client mock from vi.spyOn
(graphql-request.request is not spyable via prototype in v7) to vi.mock +
vi.mocked. Fix noUncheckedIndexedAccess TS2532 errors in viem-extension
selectors test with non-null assertions on known-present map keys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Skanislav Skanislav merged commit b530b95 into dev Apr 13, 2026
6 checks passed
@Skanislav Skanislav deleted the test/indexing-client-viem-extension branch April 15, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant