Skip to content

Commit 05bae05

Browse files
committed
test(no-large-snapshots): workaround instanceof issue in ESLint v9
1 parent 8dabd75 commit 05bae05

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/rules/__tests__/no-large-snapshots.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ ruleTester.run('no-large-snapshots', rule, {
240240
messageId: 'tooLongSnapshots',
241241
data: { lineLimit: 50, lineCount: 58 },
242242
},
243+
// todo: "instanceof" doesn't work with ESLint v9
244+
...(usingFlatConfig()
245+
? [
246+
{
247+
messageId: 'tooLongSnapshots' as const,
248+
data: { lineLimit: 50, lineCount: 58 },
249+
},
250+
]
251+
: []),
243252
],
244253
},
245254
{

src/rules/no-large-snapshots.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const reportOnViolation = (
5454
const snapshotName = getAccessorValue(node.expression.left.property);
5555

5656
isAllowed = allowedSnapshotsInFile.some(name => {
57+
/* istanbul ignore next */
5758
if (name instanceof RegExp) {
5859
return name.test(snapshotName);
5960
}

0 commit comments

Comments
 (0)