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 a class does not have a test within it, an empty .snap file gets generated regardless. This can happen when using the @Nested annotation in junit5. As an example:
@ExtendWith({SnapshotExtension.class})
class SnapshotDemoApplication {
@Nested
class NestedClass {
@Test
void nestedTest() {
SnapshotMatcher.expect("hello").toMatchSnapshot();
}
}
}
Will generate 2 .snap files:
SnapshotDemoApplication.snap (this has nothing in)
@jackmatt2 - I have just tested this against 2.1.0 and empty .snap files still seems to be created. With the example above I get an empty SnapshotDemoApplication.snap file.
When a class does not have a test within it, an empty
.snap
file gets generated regardless. This can happen when using the@Nested
annotation injunit5
. As an example:Will generate 2
.snap
files:java-snapshot version:
2.0.0-Beta6
junit-jupiter:
5.6.3
Just wondering is this expected behaviour? We are currently working around it by just ignoring those files but it is becoming a bit of a pain.
Many thanks
The text was updated successfully, but these errors were encountered: