Running Unit Tests
Before deploying your Artinals modules or integrating them into a larger project, it’s essential to thoroughly test and verify their behavior. Rigorous testing helps catch logical errors, ensure compatibility across modules (ART20, SALE, and TRADE), and maintain the confidence of creators, traders, and collectors using your system. This section covers how to run unit tests, common issues you may encounter, and strategies for debugging using the built-in debug events.
Running Unit Tests
Command:
This command runs all unit tests defined in your Move modules. Properly designed test cases cover a wide range of scenarios, from minting and transferring NFTs to executing trades and managing deny lists. As you develop, continually run these tests to catch regressions early.
Best Practices:
Comprehensive Coverage: Write tests that exercise core functionalities (minting, transferring, burning), edge cases (max supply reached, deny list full), and integration points (purchasing from SALE then trading on TRADE).
Modular Tests: Keep ART20, SALE, and TRADE tests organized. For example, start with ART20 tests to ensure NFT logic is sound before adding SALE and TRADE scenarios.
Automate Testing: Integrate tests into a continuous integration (CI) pipeline. Every code update should trigger
sui move test
to guarantee ongoing code quality.
Last updated