How to test a ledger canister with archive functionality (ICRC3) written in Motoko?

There are similar tests in this middleware here GitHub - Neutrinomic/devefi_icrc_ledger
using PicJS 🧪 Announcing PicJS: TypeScript/JavaScript support for PocketIC!
Basically, you create all the needed canisters inside the test and then make calls to their public methods and check if the results are as expected.

You can just create a ledger canister, send enough transactions (from your test script) to trigger archival, and then test the icrc3 methods. Your main ledger canister will create new archive canisters and you can test them too.

2 Likes