Registry / testing / eslint-plugin-no-snapshot-testing

eslint-plugin-no-snapshot-testing

JSON →
library1.0.61jsnpmunverified

An ESLint plugin (v1.0.61) that enforces a rule disallowing snapshot testing in Jest. It prevents calls to `toMatchSnapshot` and `toMatchInlineSnapshot`, offering an auto-fix to remove them. This package is a niche utility for teams that ban snapshot testing. It has a simple setup, only one rule, and is dependency-light. No known major alternative exists with identical focus.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESLint expects short plugin name; the 'eslint-plugin-' prefix is omitted.

plugins: ['no-snapshot-testing']

The rule name is 'no-snapshot-testing', not a shorter variant.

rules: { 'no-snapshot-testing/no-snapshot-testing': 'error' }

No official options documented; plugin is simple.

rules: { 'no-snapshot-testing/no-snapshot-testing': ['error', { ... }] }

Shows ESLint config enabling the plugin and rule, and an example of a flagged snapshot call.

// .eslintrc.js module.exports = { plugins: ['no-snapshot-testing'], rules: { 'no-snapshot-testing/no-snapshot-testing': 'error', }, }; // test.js const x = 1; expect(x).toMatchSnapshot(); // ESLint error + fix removes this line
Debug
Known footguns
gotchaThe rule name is repetitive: 'no-snapshot-testing/no-snapshot-testing'.
gotchaOnly disallows Jest snapshot matchers; not other snapshot-like patterns (e.g., manual file snapshots).
gotchaAuto-fix removes the entire `expect(...).toMatchSnapshot()` line; may remove other chained matchers if on same line.
gotchaNo support for custom matchers that wrap snapshot testing.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
4
ahrefsbot
3
script
1
Resources