Skip to content

Latest commit

 

History

History
150 lines (101 loc) · 6.16 KB

File metadata and controls

150 lines (101 loc) · 6.16 KB

Features

Contents

x.y.z

11.7.0

StoryBoard

see here

10.4.0

Configure tests to only run on specific machine

see here

10.3.0

Configure alternative Source File Directory Finder

see here

9.4.0

CombinationApprovals.verifyBestCoveringPairs

This takes advantage of a concept called pairwise testing to dramatically reduce the amount of combinations executed while retaining the vast majority of coverage. This can be very useful when running long running tests or when dealing with vast amounts of combinations. All you need to do in order to use this, is change CombinationApprovals.verifyAllCombinations to CombinationApprovals.verifyBestCoveringPairs.

Notice that for low numbers of parameters, very little is achieved, but at high numbers, the results are amazing.

Number of Parameters Variations per Parameter Total Combinations Pairwise Combinations
2 5 25 25
3 3 27 11
3 4 64 16
4 5 625 33
5 6 7,776 49
9 9 387,420,489 134

9.3.0

Printable wrappers

See How to customize another objects toString()

6.0.1

Prepare for Android

We have deprecated:

  • Approvals.verify(Image image)
  • Approvals.verify(BufferedImage bufferedImage)
  • Approvals.verify(Component c)

These are now in the AwtApprovals class.

Previous versions

Customer Approvers

If you want to customize how approvaltests decides if two files are equal, you can pass in your own deciding function.

ApprovalTextWriter writer = new ApprovalTextWriter("Random: ", new Options());
ApprovalNamer namer = Approvals.createApprovalNamer();
Function2<File, File, VerifyResult> approveEverything = (r, a) -> VerifyResult.SUCCESS;
Approvals.verify(new FileApprover(writer, namer, approveEverything));

snippet source | anchor

Using Alternative Base Directory for Approval Output Files

Q: what if I want my output files to show up under the /resources/ folder?

A: you can do that, here's how

Using Subdirectories for Approval Output Files

Approved and received files can be stored in a preferred location. More here

PackageLevelSettings

Package Level Settings allows for programmatic setting of configuration at the package level. More Here

Arlos Git Notation Prompt

This is a prompt that includes helper text and quick actions for use with Arlo's Commit Notation. It is currently the default option for TCR and will produce a window that looks like:

prompt

Faster Test Commit Revert (TCR)

The startup time for swing is around 3 seconds (on my mac). This is painfully slow in some situations. FasterTestCommitRevertRunner & FasterTestCommitRevertTest Solve this by shelling out to applescript, which brings the time down to a few milliseconds.

Note: this currently only works on mac and will default to the normal swing otherwise.

Test Commit Revert (TCR)

Note: This has been removed. Please use TCR-Extension

Usage

Use this with caution. I find Test Commit/Revert helpful when doing a strict refactoring. It is unusable when creating approvaltests as the first run always fails and gets reverted. Often I will have a test extend TCR for short periods then remove it after I'm out of a refactoring mode.

This also works well with Arlo Belshee's Git Notation


Back to User Guide