Testing & QA

Comprehensive testing strategy across all Green Goods packages.


Testing Overview

Package
Framework
Coverage Target
Command

Client

Vitest + Testing Library

70%+ (80%+ critical)

bun --filter client test

Admin

Vitest + Testing Library

70%+

bun --filter admin test

Indexer

(Integration)

N/A

Manual verification

Contracts

Foundry

80%+ (100% mainnet)

bun --filter contracts test


Running Tests

All Tests

bun test

Package-Specific

bun --filter client test
bun --filter admin test
bun --filter contracts test

Watch Mode

Coverage


Client Testing

Test Categories:

  • Component tests

  • Hook tests

  • Module/service tests

  • Integration tests

Example:

Key Tests:

  • Offline queue processing

  • Authentication flows

  • Work submission

  • Attestation creation


Admin Testing

Focus: Integration tests for workflows


Contract Testing

Foundry Tests:

Test Categories:

  • Unit tests (individual functions)

  • Integration tests (cross-contract)

  • Fork tests (against live networks)

  • Gas optimization tests

  • Upgrade safety tests

Example:


E2E Testing

Playwright (via MCP):

  • Full user journeys

  • Cross-package flows

  • Visual regression

  • Accessibility audits


Complete Testing Docs

📖 Package details:

  • Client: packages/client/.cursor/rules/testing.mdc

  • Admin: packages/admin/.cursor/rules/testing.mdc

  • Contracts: packages/contracts/.cursor/rules/testing-conventions.mdc

Last updated