test-smart-contracts

Write integration tests for Algorand smart contracts using algorandFixture and generated typed clients.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Rudhrakoushik10/RootNode --skill test-smart-contracts-rudhrakoushik10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-smart-contracts
Source: https://github.com/Rudhrakoushik10/RootNode/tree/main/projects/.opencode/skill/test-smart-contracts
Command: npx skills add https://github.com/Rudhrakoushik10/RootNode --skill test-smart-contracts-rudhrakoushik10

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing reliable tests for Algorand smart contracts requires knowing how to deploy contracts to LocalNet, manage test fixtures, fund accounts for box storage, and handle ABI return types correctly. This Skill provides canonical patterns and ready-to-adapt examples so tests work the first time. ## Core Features & Use Cases - E2E Integration Testing: Deploy contracts to LocalNet with algorandFixture and call methods through generated typed clients using Vitest or Jest. - State and Storage Patterns: Handle box funding, BoxMap references, opt-in for local state, and struct returns decoded as tuples. - Multi-User Scenarios: Create and fund additional accounts, then interact with the same app using different senders. - Use Case: You just generated a typed client for your Algorand contract and need a test that deploys it, funds the app for box storage, writes a BoxMap entry, and verifies the stored value. ## Quick Start Write an integration test for my Algorand smart contract using algorandFixture and the generated typed client.

Frequently Asked Questions about test-smart-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test an Algorand smart contract with a generated client?

Use algorandFixture from algokit-utils testing, get a typed app factory from artifacts/clients, deploy it in a helper, and call methods via client.send.methodName or client.newGroup chaining. Integration tests against LocalNet are the default approach.

Should I write unit tests or E2E tests for Algorand contracts?

Integration (E2E) tests against LocalNet are the default and recommended approach since they test real contract behavior. Unit tests with TestExecutionContext should only be used when explicitly requested or for pure logic without network interaction.

Why does my box storage test fail on Algorand LocalNet?

Box operations fail if the application account is not funded first. Send a payment of at least 1 ALGO to client.appAddress before any box or BoxMap operations, and pass correct boxReferences for BoxMap keys.

Does algorandFixture work with both Vitest and Jest?

Yes, both Vitest and Jest are supported with identical patterns. Vitest is the default in the examples, using beforeEach(localnet.newScope) with a 10-second timeout for LocalNet transaction confirmation.

How do I test multiple users interacting with the same Algorand app?

Create a second account with localnet.algorand.account.random, fund it via a payment from the test account, then call factory.getAppClientById with the same appId and the new account as defaultSender.