-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃殌 Feature: Ability to pass line number in command line to run single test #4305
Comments
Thanks for the suggestion. There are plugins to do this sort of thing for VS Code and other IDEs. See exclusive tests for another way. |
Per #5027, we're trying to avoid making big changes that don't have a lot user demand. This hasn't been touched since 2020 -and only by 1-2 folks- and would require fancy source code analysis on Mocha's end. Closing out as wontfix. If someone things I'm wrong to close this out, great! Please file a new issue with your reasoning and a link to this one. The new issue templates will prompt for the context we'd need to be able to re-triage this. We'd be happy to take a look. Cheers all! 馃 |
Is your feature request related to a problem or a nice-to-have?? Please describe.
It is quite convenient to be able to tell an IDE to start a specific test, and the absolute simplest way to pass this information out is to refer to the cursor's position in the file.
Describe the solution you'd like
I'd like to see that
mocha ./test/myfile.js:42
runs the test that surrounds line 42.Describe alternatives you've considered
telling the editor to do AST analysis to figure out where the test function starts so I can take the string and grep it -- seemed like too much work to put on the client side.
Additional context
There are other tools that do this, notably in the Ruby world, and it's incredibly convenient to hold a TDD cycle.
The text was updated successfully, but these errors were encountered: