Skip to content

approvals/ApprovalTests.shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

a tiny implementation of Approval Tests for the cli

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages