Skip to content

Commit 6be0275

Browse files
authored
Merge pull request #14 from kamiazya/fix_to_be_valid_dot_and_match_snapshot_matcher
fix bug for toBeValidDotAndMatchSnapshotMatcher
2 parents 75f650a + 019a987 commit 6be0275

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/to-be-valid-dot-and-match-snapshot.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ declare global {
1515
}
1616

1717
export function toBeValidDotAndMatchSnapshotMatcher(this: any, dot: string): jest.CustomMatcherResult {
18-
return isValidDot(dot) && toMatchSnapshot.call(this, dot);
18+
const result = isValidDot(dot);
19+
if (result.pass) {
20+
return toMatchSnapshot.call(this, dot);
21+
}
22+
return result;
1923
}
2024

2125
expect.extend({ toBeValidDotAndMatchSnapshot: toBeValidDotAndMatchSnapshotMatcher });

0 commit comments

Comments
 (0)