Skip to content

Nick2bad4u/eslint-plugin-test-signal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

eslint-plugin-test-signal

npm license. npm total downloads. latest GitHub release. GitHub stars. GitHub forks. GitHub open issues. codecov.

ESLint plugin for flagging weak tests before they become false confidence.

The first rule set focuses on:

  • snapshot-only coverage;
  • mock-call-only tests;
  • unawaited Promise assertions;
  • async tests without assertions;
  • suites that never exercise a negative path.

Table of contents

  1. Installation
  2. Quick start
  3. Presets
  4. Rules
  5. Compatibility

Installation

npm install --save-dev eslint-plugin-test-signal eslint typescript

Quick start

import testSignal from "eslint-plugin-test-signal";

export default [testSignal.configs.recommended];

The bundled presets target common test file globs and register @typescript-eslint/parser automatically.

Presets

import testSignal from "eslint-plugin-test-signal";

export default [
 testSignal.configs.minimal,
 // testSignal.configs.recommended,
 // testSignal.configs["recommended-type-checked"],
 // testSignal.configs.strict,
 // testSignal.configs.all,
 // testSignal.configs.experimental,
];
Preset Intent
testSignal.configs.minimal Lowest-noise async correctness checks.
testSignal.configs.recommended Default weak-test signal coverage.
testSignal.configs["recommended-type-checked"] Compatibility preset for future typed rules.
testSignal.configs.strict Recommended plus negative-path coverage enforcement.
testSignal.configs.all Every stable rule.
testSignal.configs.experimental Stable rules plus future candidates.

Rules

Rule Fix Preset key
no-assertions-in-hooks - πŸ”΄ 🟣
no-async-foreach-assertions - 🟑 πŸ”΄ 🟣
no-broad-object-key-count-assertions - πŸ”΄ 🟣
no-conditional-assertions - 🟑 πŸ”΄ 🟣
no-constant-assertions - 🟑 πŸ”΄ 🟣
no-disabled-tests - 🟑 πŸ”΄ 🟣
no-duplicate-assertions - πŸ”΄ 🟣
no-empty-async-tests - 🟒 🟑 πŸ”΄ 🟣
no-fixed-delay-tests - πŸ”΄ 🟣
no-focused-tests - 🟒 🟑 πŸ”΄ 🟣
no-identical-expected-actual - 🟑 πŸ”΄ 🟣
no-mock-call-only-tests - 🟑 πŸ”΄ 🟣
no-snapshot-only-tests - 🟑 πŸ”΄ 🟣
no-synthetic-promise-assertions - 🟑 πŸ”΄ 🟣
no-tautological-length-assertions - 🟑 πŸ”΄ 🟣
no-try-catch-assertions - πŸ”΄ 🟣
no-vacuous-numeric-assertions - 🟑 πŸ”΄ 🟣
no-vacuous-string-assertions - 🟑 πŸ”΄ 🟣
no-weak-asymmetric-assertions - 🟑 πŸ”΄ 🟣
no-weak-existence-assertions - 🟑 πŸ”΄ 🟣
no-weak-truthy-assertions - 🟑 πŸ”΄ 🟣
require-assertions - 🟑 πŸ”΄ 🟣
require-awaited-async-assertions - 🟒 🟑 πŸ”΄ 🟣
require-error-message-assertions - πŸ”΄ 🟣
require-negative-path - πŸ”΄ 🟣

Compatibility

  • Supported ESLint versions: 9.x and 10.x
  • Config system: Flat Config
  • Node.js runtime: >=22.0.0

About

ESLint plugin to flag weak tests: snapshot-only coverage, mock-call-only tests, unawaited assertions, no negative path, and empty async tests.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors