goldie
Simple golden file testing for Rust.
goldie::assert!(text);
🚀 Getting started
Add goldie
to your project as a dev dependency.
In your test function assert the contents using goldie::assert!
. The golden
filename will be automatically determined based on the test file and test
function name. Run tests with GOLDIE_UPDATE=true
to automatically update
golden files.
Templated golden files are also supported using goldie::assert_template!
.
Something implementing serde::Serialize
needs to be provided as context in
order to render the template. Values are rendered using
upon e.g. {{ value.field }}
.
You cannot use GOLDIE_UPDATE=true
to automatically update templated golden
files.
License
This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.