Загрузка...

Integration testing with solana-test-validator — Forge College

Why run integration tests against a local validator? Unit tests catch instruction-level bugs, but multi-instruction flows, cross-account state changes, and program interactions often only surface when exercised end-to-end against a running validator like solana-test-validator.

What you'll learn: This lesson shows how to start and configure a persistent solana-test-validator instance, capture its logs, and inspect validator state snapshots for debugging. You will author an Anchor integration test script in TypeScript (for example tests/integration.ts) that connects to the running validator, executes sequences of instructions, and asserts account state after each logical step. Learn how to use the Anchor Provider, program.rpc calls, and direct account fetches to verify cross-instruction state transitions and program call ordering. The lesson also covers simple CLI checks and techniques to correlate test output with validator logs so failures are reproducible and diagnosable.

Who this is for: Beginner Solana developers who have written unit tests and know the basics of Anchor and the Solana CLI. No advanced experience required—this lesson assumes familiarity with starting a local validator and basic Anchor test scaffolds.

Key topics covered:
- Starting and configuring a persistent solana-test-validator and capturing logs
- Writing Anchor integration tests in TypeScript (tests/integration.ts) that run against a running validator
- Asserting cross-instruction state transitions using Anchor Provider, program.rpc, and account fetches
- Collecting on-chain logs, validator snapshots, and using solana-cli checks to validate account contents
- Debugging multi-transaction flows and correlating test output with validator logs

Get hands-on and follow the examples in this lesson to build reliable end-to-end tests for your programs. Learn more at https://www.forge.college/

Видео Integration testing with solana-test-validator — Forge College канала Forge College
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять