goldie
Simple golden file testing for Rust.
!;
assert
🚀 Getting started
Add the following to your Cargo manifest.
[]
= "0.1"
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
TinyTemplate e.g. {value.field}
.
You cannot use GOLDIE_UPDATE=true
to automatically update templated golden
files.
use json;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.