You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JUnit's Parameterized test runner, snapshot testing can not be used, as only one snapshot per test method is permitted due to the way that the snapshot is resolved on subsequent runs.
I've tried a small change to support passing qualifiers through to the matcher:
private String someParameter;
public ATestClass(String someParameter) throws IOException {
this.someParameter = someParameter;
}
@Test
public void test() throws Exception {
Object actual = ...
expect(actual).toMatchSnapshot(someParameter);
}
and
public void toMatchSnapshot(Object... qualifiers) {
This seems to work pretty well. The .snap ends up as you would expect:
ATestClass.test(theValueOfSomeParameter)=[
I'm happy to raise a PR if this would be of interest.
Thanks,
-Dan
The text was updated successfully, but these errors were encountered:
Hi,
When using JUnit's Parameterized test runner, snapshot testing can not be used, as only one snapshot per test method is permitted due to the way that the snapshot is resolved on subsequent runs.
I've tried a small change to support passing qualifiers through to the matcher:
and
This seems to work pretty well. The
.snap
ends up as you would expect:I'm happy to raise a PR if this would be of interest.
Thanks,
-Dan
The text was updated successfully, but these errors were encountered: