An *Actual* ".only" #48895
Labels
feature request
Issues that request new features to be added to Node.js.
test_runner
Issues and PRs related to the test runner subsystem.
What is the problem this feature will solve?
Imagine you have a function with 50 tests. You add a
console.log
to debug just one of those tests, but of course you seeconsole.log
output 50x times, creating a giant signal-to-noise ratio problem..only
solves this in other major testing frameworks. In most other test frameworks I can simply do:That's it! I can now run my tests, the exact same way I did before, but now I just see the
console.log
from the one test I marked as "only".That's not how it works in Node however. In Node I also have to add:
to the test's
describe
... only that's not enough: I also have to add:to my test-running-command.
You'd think "ok, that's runOnly stuff is pointless boilerplate, but you just add it to every test file and you're fine, right?" Wrong. Because when I run the tests normally, that line causes an error:
In other words, to be able to just (occasionally) run a single test, I have to add this boilerplate to every test file:
Then I have to switch which test command I use ... and I still have to mark the test as
.only
(as I would in another framework).This is all a mess. There should be a way to just run one test out of 50 easily!
What is the feature you are proposing to solve the problem?
Make
.only
work the same as it does in other major test frameworks (ie. all you need is.only
), or add a new feature (with a new name: ".justThis") which works similarly.What alternatives have you considered?
Going back to Mocha or Jest :(
The text was updated successfully, but these errors were encountered: