Testing in Stylus is limited today. While developing OpenZeppelin Contracts for Stylus we created a few helpers to test our contracts, and we've decided to open source them and publish them as a separate crate for the community, at least until a more comprehensive testing framework is available.
This crate is a work in progress, and we'll be adding more features and improving the ergonomics as we go. We encourage projects that find this useful to contribute by opening issues and pull requests.
This crate enables unit-testing for Stylus contracts. It abstracts away the
machinery necessary for writing tests behind a #[motsu::test]
procedural
macro.
motsu
means "[to hold]" in Japanese -- we hold a stylus in our hand.
Add motsu to your project's dependencies:
[dev-dependencies]
motsu = "=0.10.0"
[dependencies]
stylus-sdk = "=0.9.0"
If you're interested in contributing, please check our contribution guidelines.
Refer to our Security Policy for more details.