- x.y.z
- 11.7.0
- 10.4.0
- 10.3.0
- 9.4.0
- 9.3.0
- 6.0.1
- Previous versions
- Customer Approvers
- Using Alternative Base Directory for Approval Output Files
- Using Subdirectories for Approval Output Files
- PackageLevelSettings
- Arlos Git Notation Prompt
- Faster Test Commit Revert (TCR)
- Test Commit Revert (TCR)
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 |
See How to customize another objects toString()
We have deprecated:
Approvals.verify(Image image)Approvals.verify(BufferedImage bufferedImage)Approvals.verify(Component c)
These are now in the AwtApprovals class.
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));Q: what if I want my output files to show up under the /resources/ folder?
A: you can do that, here's how
Approved and received files can be stored in a preferred location. More here
Package Level Settings allows for programmatic setting of configuration at the package level. More Here
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:
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.
Note: This has been removed. Please use TCR-Extension
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
