Command Line Interface (CLI) for Snappylapy
Welcome to the snappylapy CLI!
Use these commands to initialize your repository, update or clear test results and snapshots, and review differences between your test results and snapshots using the 'diff' command.
- Run 'init' to set up your repo for snappylapy.
- Use 'update' to refresh snapshots with the latest test results.
- Use 'clear' to remove all test results and snapshots (add --force to skip confirmation).
- Use 'diff' to view changes between test results and snapshots in your editor.
For more details on each command, use --help after the command name.
Usage:
$ snappylapy [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion
: Install completion for the current shell.--show-completion
: Show completion for the current shell, to copy it or customize the installation.--help
: Show this message and exit.
Commands:
init
: Run this command to initialize your...clear
: Use this command to clear all test results...update
: Use this command to update all snapshot...diff
: Show the differences between the test...
snappylapy init
Run this command to initialize your repository for snappylapy.
This will add a line to your .gitignore file to ensure test results are not tracked by git.
Usage:
$ snappylapy init [OPTIONS]
Options:
--help
: Show this message and exit.
snappylapy clear
Use this command to clear all test results and snapshots created by snappylapy.
This will recursively delete all files and directories related to test results and snapshots. Use --force to skip confirmation.
This finds and deletes all __test_results__
and __snapshots__
directories recursively across the working directory.
Usage:
$ snappylapy clear [OPTIONS]
Options:
-f, --force
: Force deletion without confirmation--help
: Show this message and exit.
snappylapy update
Use this command to update all snapshot files with the latest test results.
This will overwrite existing snapshots with current test outputs, ensuring your snapshots reflect the latest changes.
The file contents of any files in any of the __test_results__
folders will be copied to the corresponding __snapshots__
folder.
Usage:
$ snappylapy update [OPTIONS]
Options:
--help
: Show this message and exit.
snappylapy diff
Show the differences between the test results and the snapshots.
Opens all of the changed diffs in the Visual Studio Code (VSCode) editor.
This requires that you have VSCode installed and the code
command available in your PATH.
More diff viewers will be supported in the future, please raise a request on github with your needs.
Usage:
$ snappylapy diff [OPTIONS]
Options:
--help
: Show this message and exit.