Testing

Cairo is a programming language that cares a lot about correctness and it includes support for writing software tests within the language itself through two testing frameworks: Cairo Test and Starknet Foundry. While Starknet Foundry is principally aimed at Starknet development, it presents useful features for pure Cairo development as well, which makes it the preferred choice for most Cairo developers. The examples presented here will use Starknet Foundry.

Testing comes in two styles:

Also, Cairo has support for specifying additional dependencies for tests:

See Also