askill
aztec-e2e-testing

aztec-e2e-testingSafety 95Repository

Generate end-to-end tests for Aztec contracts with real network interaction. Use when writing integration tests, testing contract deployments, or validating full transaction flows. Supports Vitest (recommended) and Jest.

8 stars
1.2k downloads
Updated 3/5/2026

Package Files

Loading files...
SKILL.md

Aztec E2E Testing Skill

Generate end-to-end tests for Aztec contracts against live networks. Vitest is the default test runner in v4; Jest is also supported.

Subskills

Quick Start: Basic E2E Test

import { MyContract } from "../../artifacts/MyContract.js";
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
import { setupWallet } from "../../utils/setup_wallet.js";
import { getSponsoredFPCInstance } from "../../utils/sponsored_fpc.js";
import { SponsoredFPCContractArtifact } from "@aztec/noir-contracts.js/SponsoredFPC";
import { Fr, GrumpkinScalar } from "@aztec/aztec.js/fields";
import { AztecAddress } from "@aztec/stdlib/aztec-address";
import { EmbeddedWallet } from '@aztec/wallets/embedded';
import { AccountManager } from "@aztec/aztec.js/wallet";
import { TxStatus } from "@aztec/stdlib/tx";
import { getTimeouts } from "../../../config/config.js";

describe("MyContract", () => {
    let wallet: EmbeddedWallet;
    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, SponsoredFPCContractArtifact);
        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);
        const deployMethod = await account.getDeployMethod();
        await deployMethod.simulate({ from: AztecAddress.ZERO });
        await deployMethod.send({
            from: AztecAddress.ZERO,
            fee: { paymentMethod },
            wait: { timeout: getTimeouts().deployTimeout },
        });

        // Deploy contract
        const deployRequest = MyContract.deploy(wallet, account.address);
        await deployRequest.simulate({ from: account.address });
        contract = await deployRequest.send({
            from: account.address,
            fee: { paymentMethod },
            wait: { timeout: getTimeouts().deployTimeout },
        }).deployed();
    }, 600000);

    it("should perform an action", async () => {
        await contract.methods.myMethod(args).simulate({ from: account.address });
        const tx = await contract.methods.myMethod(args).send({
            from: account.address,
            fee: { paymentMethod },
            wait: { timeout: getTimeouts().txTimeout },
        });

        expect([TxStatus.PROPOSED, TxStatus.CHECKPOINTED, TxStatus.PROVEN, TxStatus.FINALIZED])
            .toContain(tx.status);
    }, 60000);
});

Key Differences from Noir Tests

AspectNoir (TestEnvironment)TypeScript (E2E)
NetworkSimulatedReal (local/devnet)
FeesNot requiredRequired
ProofsSimulatedReal (on devnet)
SpeedFastSlower
StateIn-memoryPersistent

When to Use E2E Tests

  • Integration with real network behavior
  • Fee payment verification
  • Multi-account scenarios
  • Full deployment pipeline testing
  • Cross-contract interactions
  • Production readiness validation

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

83/100Analyzed 3/8/2026

Well-structured E2E testing skill with clear use cases, copy-paste-ready code examples, and good organization. Includes comparison table between Noir and TypeScript approaches, clear "when to use" guidance, and references to subskills. Minor扣分 for project-specific paths and lack of detailed explanations in code, but overall highly actionable for Aztec testing.

95
90
75
85
82

Metadata

Licenseunknown
Version-
Updated3/5/2026
Publishercritesjosh

Tags

ci-cdtesting