Skip to content

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

License

Notifications You must be signed in to change notification settings

akhilmhdh/cli-snap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages