#macros #macro-rules #tests #testing #mocha


Macro crate that expands Mocha syntax to standard Rust syntax

3 releases

0.1.2 Feb 6, 2020
0.1.1 Feb 6, 2020
0.1.0 Feb 6, 2020

#442 in Testing

MIT license



Ever wanted Mocha's describe/it syntax in Rust? No? Well here it is anyway! This crate simply contains two macros describe! and it! that expand into Rust's native test constructs.


describe!(test_suite, {
    it!(does_something, {
        assert_eq!(1, 1);

    it!(does_something_else, {

Is equivalent to

mod test_suite {
    fn does_something() {
        assert_eq!(1, 1);

    fn does_something_else() {


Install the crate by adding latte to your Cargo.toml's dependencies and then simply add this import to your code:

extern crate latte;


There really is no purpose to this. It's arguably a bit easier to read because you don't have a bunch of attributes cluttering up the place, but ultimately this was just an exercise to learn the basics of macro_rules!. If you do happen to find this library somewhat useful and would like to see some features added, let me know on GitHub or submit a pull request.

No runtime deps