1.0.0 • Published 5 years ago
@jghennes/snap v1.0.0
snap
snap is a cli tool intended to make automated snapshot testing of api endpoints easier.
Syntax
Generate a new snapshot
snapshot take <endpoint_file_path> [-n output file name] [-e config to use]
Options:
-n --fileName
: A name for the generated snapshot file. Defaults to the file name of the endpoint file provided.
-e --envConf
: Environment (host, port) to run the snapshots against. Defaults to ./host-config.json
Run a test against a snapshot
snapshot compare <snap_file_path> [-e config to use]
Options:
-e --envConf
: Environment (host, port) to run the snapshots against. Defaults to ./host-config.json
File Format
Both the endpoint_file
and snap_file
needed to be formated as a json object in a file like so:
{
"[api path]": JSON result
}
1.0.0
5 years ago