Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an easy bulk approve-all method #47

Open
davidalpert opened this issue Jan 28, 2024 · 1 comment
Open

Add an easy bulk approve-all method #47

davidalpert opened this issue Jan 28, 2024 · 1 comment

Comments

@davidalpert
Copy link

While working with approval tests it is sometimes the case that one code change can result in many similar changes to a set of previously baselined approved files.

In this scenario it can be simpler to bulk approve all and use source control tools to scan the approved files for diffs rather than to review each received vs approval one by one in the configured diff reporter.

It would be helpful to add a mechanism to bulk approve all verifications, either as another verifyOptions helper

type verifyOptions struct {
scrubbers []scrubber
extWithDot string
}

Or as an environment variable.

In some ruby-based approval use cases, for example, I have patched in an optional environment variable APPROVE_ALL; when set to something non-empty (e.g. 1 or 'true') all received diffs are approved.

@davidalpert davidalpert changed the title Add easy approve-all method Add an easy bulk approve-all method Jan 28, 2024
@tyrcho
Copy link

tyrcho commented May 13, 2024

a possible workaround (this is what I usually do) :

 find . -name "*received.txt" -exec bash -c 'mv $0 ${0/received/approved}' {} \;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants