Skip to content

Commit d77a688

Browse files
committed
fix(no-large-snapshots): don't use instanceof for checking regexps
1 parent 0ff9935 commit d77a688

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rules/no-large-snapshots.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ const reportOnViolation = (
5454
const snapshotName = getAccessorValue(node.expression.left.property);
5555

5656
isAllowed = allowedSnapshotsInFile.some(name => {
57-
if (name instanceof RegExp) {
58-
return name.test(snapshotName);
57+
if (typeof name === 'string') {
58+
return snapshotName === name;
5959
}
6060

61-
return snapshotName === name;
61+
return name.test(snapshotName);
6262
});
6363
}
6464
}

0 commit comments

Comments
 (0)