Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 978 Bytes

README.md

File metadata and controls

43 lines (26 loc) · 978 Bytes

ApprovalTests in the Shell

Note: only tested with bash.

CI

Background

This is a minimal Approval-Tests utility for the cli.

BTW, ChatGPT helped to get things started.

Usage

Given a command <test-command> that produces some output to verify, use the verify.sh script like this:

<test-command> | ./verify.sh -t <test-name> [-d <diff-tool>]

If the result of <test-command> differs from the approved result, the <diff-tool> will be triggered.

Examples

Simplest form

echo "hello world!" | ./verify.sh -t hello-world

Specify a different diff tool

echo "hello diff tool" | ./verify.sh -t hello-diff -d "git diff --no-index"

Run the Tests

(yes, verify.sh is used to test itself)

(cd bash && ./test.sh | ./verify.sh -t verify-cli-bash)