jestjs/jest

[Feature]: Detect unused stubs in test code

Open

#12,296 创建于 2022年2月3日

在 GitHub 查看
 (13 评论) (10 反应) (0 负责人)TypeScript (6,653 fork)batch import
:rocket: Feature RequestHelp WantedPinned

仓库指标

Star
 (45,361 star)
PR 合并指标
 (平均合并 11天 22小时) (30 天内合并 11 个 PR)

描述

🚀 Feature Proposal

As described in this article, JUnit and Mockito support detecting unnecessary stubs and tell the user to remove them. It would be great to have that feature in Jest.

Motivation

Removing unused stubs makes the test code cleaner and more maintainable.

Example

No response

Pitch

Removing unused stubs makes the test code cleaner and more maintainable. This leads to users writing cleaner and more delightful tests and prevents certain errors from happening when users expect their stubs to be responsible for a specific behavior when actually they have never been called.

贡献者指南