stacksdapp test runs contract tests (Clarinet SDK with vitest-environment-clarinet) and frontend tests (Vitest). No Docker or local devnet is required for contract tests.
Contents
Run all tests
- Contracts: Vitest + Clarinet SDK in
contracts/tests/(globalsimnetfromvitest-environment-clarinet) - Frontend: Vitest in
frontend/(vitest run --passWithNoTests)
Contract tests
Tests live undercontracts/tests/. The scaffold template uses the clarinet Vitest environment with a global simnet instance:
stacksdapp add --template sip010|sip009.
Requires Clarinet 3.23+ and matching @stacks/clarinet-sdk in the contracts package.
ABI caching
Contract ABIs are cached undercontracts/.cache/. Unchanged sources skip redundant initSimnet runs during generate and test workflows.
Type-check before testing
Frontend tests
Frontend Vitest suites live underfrontend/. They run as part of stacksdapp test even if you have not written tests yet.
Tips
- Use simnet tests for contract logic
- Use local devnet or testnet for full wallet flows
- After editing contracts, run
stacksdapp generateso bindings stay aligned with tests that import generated code - Prefer testnet over devnet for reliable deploy verification