Skip to content
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

Closed
Trevoke opened this issue May 28, 2020 · 2 comments
Closed
Labels
status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: feature enhancement proposal

Comments

@Trevoke
Copy link

Trevoke commented May 28, 2020

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.

@Trevoke Trevoke added the type: feature enhancement proposal label May 28, 2020
@boneskull
Copy link
Member

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.

@JoshuaKGoldberg JoshuaKGoldberg changed the title Ability to pass line number in command line to run single test 馃殌 Feature: Ability to pass line number in command line to run single test Dec 27, 2023
@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Feb 6, 2024

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! 馃

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@JoshuaKGoldberg JoshuaKGoldberg added the status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

3 participants