json-snapshot.github.io icon indicating copy to clipboard operation
json-snapshot.github.io copied to clipboard

Build a JUnit 5 Extension for the Snapshotmatcher Library

Open rgordon1982 opened this issue 6 years ago • 1 comments

This PR adds in a Junit5 Extension to easily use this great library when using JUnit5. The Extension @ExtendWith(SnapshotMatcherExtension.class) can be added at the class or individual test level. Once added, the SnapshotMatcher framework is initialized before each test and validated after each test runs.

It tries to takes advantage of JUnits Extension framework wherever possible. For instance, local state is now stored inside of the ExtensionContext which is local to each executed test. Also, config values can now be supplied as System properties and pulled out of the ExtensionContext (i.e. directory for snaps). Finally it adds support for Parameterized test and their dynamic test names.

rgordon1982 avatar Apr 03 '19 17:04 rgordon1982

Any progress on this?

NicklasWallgren avatar Apr 28 '20 12:04 NicklasWallgren