Should Up
Remove all those "should" prefixes cluttering up your JS unit test descriptions!
When you run should-up
, it'll go through all the files in the directory you specify, cleaning up as many test descriptions as it can. Afterwards, the changes should look something like this.
Before | After |
---|---|
|
|
Installation
npm install -g should-up
Usage
should-up /path/to/your/tests
Rationale
As you can see from the following highly scientific table of data, there's a pretty strong negative correlation between the readability of your test descriptions and the amount of meaningless filler in them.
Readability | Amount of meaningless filler |
---|---|
Total Disaster ⭐️ |
|
Still Very Bad ⭐️⭐️ |
|
You Are Here → ⭐️⭐️⭐️⭐️ |
|
All Killer No Filler ⭐️⭐️⭐️⭐️⭐️ |
|
Anyway, when we start everything with the word "should", it sounds like we're not really 100% sure about what our code does. Like maybe we're even a little bit pessimistic that it works at all, but we're crossing our fingers and hoping for the best anyway.
Well... it should dispatch an event on click, but I dunno. Just... look, you can run it if you want, but don't come to me if it breaks is all I'm saying.
When you say something like it('dispatches an event on click')
instead, it's literally a more enjoyable thing to write.
It makes you feel like you're more certain about what your code's doing, and also more proud of your concise new unit test descriptions.
Contributing
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.