Use ancestors to determine test framework in code lens
Depends on #1333
We currently try to determine the test framework based on dependencies. This is an okay approach, but once we have ancestors available we can be a lot more accurate.
We can check if a test inherits from Minitest::Test or Test::Unit::TestCase and then decide based on that - ideally with a fallback if we can't determine the framework for whatever reason.
That would be great.
This issue is being marked as stale because there was no activity in the last 2 months
As a note, when we implement this, we should look for extend ActiveSupport::Testing::Declarative instead of < ActiveSupport::TestCase.
That would let us support users who want to support the declarative syntax of AS::TC, who don't wish to use the whole thing.
+1 This would be a great feature!
+1 - I use rspec-mocks in a project, but use Minitest as the test runner and Ruby LSP is detecting the test framework as rspec because it's only checking for the string rspec in any of the dependencies. The code lenses are not showing up in the Minitest tests, or in the Test Explorer.
Can an option be added to explicitly override the test framework?
Can an option be added to explicitly override the test framework?
I would rather just implement the correct solution straight away. I'd avoid adding more configuration for something we can properly detect automatically.
Also, there are other corner cases that wouldn't be covered, like someone who reported using both RSpec and Minitest in the same application.
While I understand not wanting to add an additional configuration option, doing so solves many of the use-cases quickly and the auto mode can be incrementally improved until it won't be as necessary.
Complete in the new implementation of the explorer that's currently rolling out to users.