birdie
Functions
pub fn main() -> Nil
Reviews the snapshots in the project’s folder.
This function will behave differently depending on the command line
arguments provided to the program.
To have a look at all the available options you can run
gleam run -m birdie help
.
🐦⬛ The recommended workflow is to first run your gleeunit tests with
gleam test
and then review any new/failing snapshot manually runninggleam run -m birdie
.And don’t forget to commit your snapshots! Those should be treated as code and checked with the vcs you’re using.
pub fn snap(content content: String, title title: String) -> Nil
Performs a snapshot test with the given title, saving the content to a new
snapshot file. All your snapshots will be stored in a folder called
birdie_snapshots
in the project’s root.
The test will fail if there already is an accepted snapshot with the same title and a different content. The test will also fail if there’s no accepted snapshot with the same title to make sure you will review new snapshots as well.
🚨 A snapshot is saved to a file named after its title, so all titles should be unique! Otherwise you’d end up comparing unrelated snapshots.
🐦⬛ To review all your snapshots interactively you can run
gleam run -m birdie
.To get an help text and all the available options you can run
gleam run -m birdie help
.