diff --git a/src/rules/require-local-test-context-for-concurrent-snapshots.ts b/src/rules/require-local-test-context-for-concurrent-snapshots.ts index 9b8768c..d548088 100644 --- a/src/rules/require-local-test-context-for-concurrent-snapshots.ts +++ b/src/rules/require-local-test-context-for-concurrent-snapshots.ts @@ -26,7 +26,10 @@ export default createEslintRule({ const isNotASnapshotAssertion = ![ 'toMatchSnapshot', - 'toMatchInlineSnapshot' + 'toMatchInlineSnapshot', + 'toMatchFileSnapshot', + 'toThrowErrorMatchingSnapshot', + 'toThrowErrorMatchingInlineSnapshot' ].includes(node.callee.property.name) if (isNotASnapshotAssertion) return diff --git a/tests/require-local-test-context-for-concurrent-snapshots.test.ts b/tests/require-local-test-context-for-concurrent-snapshots.test.ts index f9692d9..a8f3f56 100644 --- a/tests/require-local-test-context-for-concurrent-snapshots.test.ts +++ b/tests/require-local-test-context-for-concurrent-snapshots.test.ts @@ -53,6 +53,18 @@ ruleTester.run(RULE_NAME, rule, { expect(true).toMatchSnapshot(); })`, errors: [{ messageId: 'requireLocalTestContext' }] - } + }, + { + code: 'it.concurrent("should fail", () => { expect(true).toMatchFileSnapshot("./test/basic.output.html") })', + errors: [{ messageId: 'requireLocalTestContext' }] + }, + { + code: 'it.concurrent("should fail", () => { expect(foo()).toThrowErrorMatchingSnapshot() })', + errors: [{ messageId: 'requireLocalTestContext' }] + }, + { + code: 'it.concurrent("should fail", () => { expect(foo()).toThrowErrorMatchingInlineSnapshot("bar") })', + errors: [{ messageId: 'requireLocalTestContext' }] + }, ] })