Add a test for an Aztec contract function
Creates comprehensive Aztec contract tests with setup, execution, and assertion patterns.
/plugin marketplace add critesjosh/aztec-claude-plugin/plugin install critesjosh-aztec@critesjosh/aztec-claude-pluginAdd a test for the Aztec contract function described as: "$ARGUMENTS"
Read the contract to understand the function being tested
Create a comprehensive test that covers:
Include tests for:
#[test(should_fail)] or #[test(should_fail_with = "error message")] for unauthorized access)Use the TestEnvironment properly:
#[test]
unconstrained fn test_something() {
let mut env = TestEnvironment::new();
let owner = env.create_light_account();
let initializer = MyContract::interface().constructor(param1, param2);
let contract_address = env.deploy("ContractName").with_public_initializer(owner, initializer);
}
Remember to:
env.create_light_account() to create test accountsenv.call_private(account, Contract::at(address).function()) for private functionsenv.call_public(account, Contract::at(address).function()) for public functions.view_public() for view operations on public statePlace the test in the appropriate test file, following the project's testing conventions.