馃И Testing: Establish a preference for small, self-contained mutation tests #1504
Labels
area: documentation
Improvements or additions to docs 馃摑
area: testing
Improving how the repository's tests are run and/or code is tested 馃И
status: accepting prs
Please, send a pull request to resolve this! 馃檹
Overview
This is something I'd wanted to start on ages ago, but never had the time and never got around to writing down...
Today, there are quite a few mutation tests that have a lot of stuff in them. Example: https://github.com/JoshuaKGoldberg/TypeStat/blob/16f76cf106033d5ca45da3eed82de3120aae4c08/test/cases/fixes/noImplicitAny/variableDeclarations/original.ts is just over 200 lines. Large mutation tests were handy when I was getting started on TypeStat many years ago and wanted to quickly iterate on many things at once.
But, the library is a bit more settled now, and these huge tests are unwieldy. It's hard to precisely check one thing at a time with them or search for where one thing is tested for. Example: to test
noImplicitAny
with variable declarations and Promise resolves, I'd probably temporarily comment out all but the last ~10 lines of the aforementionedvariableDeclarations/original.ts
file.Proposal: let's...
.github/DEVELOPMENT.md
a preference for small, self-contained mutation testsoriginal.ts
files into families of more granular onesWDYT @rubiesonthesky?
The text was updated successfully, but these errors were encountered: