Generate Jest end-to-end tests for Aztec contracts with real network interaction. Use when writing integration tests, testing contract deployments, or validating full transaction flows.
/plugin marketplace add critesjosh/aztec-claude-plugin/plugin install critesjosh-aztec@critesjosh/aztec-claude-pluginThis skill is limited to using the following tools:
jest-setup.mdsponsored-testing.mdtest-patterns.mdGenerate Jest end-to-end tests for Aztec contracts against live networks.
import { MyContract } from "../../artifacts/MyContract.js";
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
import { setupWallet } from "../../utils/setup_wallet.js";
import { getSponsoredFPCInstance } from "../../utils/sponsored_fpc.js";
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
import { Fr, GrumpkinScalar } from "@aztec/aztec.js/fields";
import { AztecAddress } from "@aztec/stdlib/aztec-address";
import { TxStatus } from "@aztec/stdlib/tx";
import { TestWallet } from '@aztec/test-wallet/server';
import { AccountManager } from "@aztec/aztec.js/wallet";
import { getTimeouts } from "../../../config/config.js";
describe("MyContract", () => {
let wallet: TestWallet;
let account: AccountManager;
let contract: MyContract;
let paymentMethod: SponsoredFeePaymentMethod;
beforeAll(async () => {
// Setup wallet
wallet = await setupWallet();
// Setup sponsored fees
const sponsoredFPC = await getSponsoredFPCInstance();
await wallet.registerContract(sponsoredFPC, SponsoredFPCContract.artifact);
paymentMethod = new SponsoredFeePaymentMethod(sponsoredFPC.address);
// Create and deploy account
const secretKey = Fr.random();
const signingKey = GrumpkinScalar.random();
const salt = Fr.random();
account = await wallet.createSchnorrAccount(secretKey, salt, signingKey);
await (await account.getDeployMethod()).send({
from: AztecAddress.ZERO,
fee: { paymentMethod }
}).wait({ timeout: getTimeouts().deployTimeout });
// Deploy contract
contract = await MyContract.deploy(wallet, account.address).send({
from: account.address,
fee: { paymentMethod }
}).deployed({ timeout: getTimeouts().deployTimeout });
}, 600000);
it("should perform an action", async () => {
const tx = await contract.methods.myMethod(args).send({
from: account.address,
fee: { paymentMethod }
}).wait({ timeout: getTimeouts().txTimeout });
expect(tx.status).toBe(TxStatus.SUCCESS);
}, 60000);
});
| Aspect | Noir (TestEnvironment) | TypeScript (Jest) |
|---|---|---|
| Network | Simulated | Real (local/devnet) |
| Fees | Not required | Required |
| Proofs | Simulated | Real (on devnet) |
| Speed | Fast | Slower |
| State | In-memory | Persistent |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.