cli-snap

Crates.iocli-snap
lib.rscli-snap
version0.1.0
sourcesrc
created_at2024-04-21 14:49:32.818826
updated_at2024-04-21 14:49:32.818826
descriptioncli-snap is a command-line interface (CLI) tool designed for testing other CLI applications using a snapshot-based testing strategy.
homepagehttps://github.com/akhilmhdh/cli-snap
repositoryhttps://github.com/akhilmhdh/cli-snap
max_upload_size
id1215443
size18,726
Akhil Mohan (akhilmhdh)

documentation

README

CLI SNAP

cli-snap is a command-line interface (CLI) tool designed for testing other CLI applications using a snapshot-based testing strategy.

Installation

Using cargo

cargo install cli-snap

Usage

  1. Create a test suite file named cli-snap.toml to define your testing commands:
[[tests]]
commands = ["echo 'Hello'"]
id = "hello-world"

[[tests]]
commands = ["echo 'test 2'", "echo 'second hello'"]
id = "test-2"

[config]
snapshot_directory = "./snaps"

| Ensure each test has a unique ID to distinguish and identify each snapshot.

  1. Run the test suite using the following command:
cli-snap --config <directory where you have saved toml>

output image

  1. To update snapshots, run the command.
cli-snap --config <directory where you have saved toml> --update-snapshot
Commit count: 6

cargo fmt