scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Add support for ScalaTest AnyFeatureSpec #398

Open collers opened 2 months ago

collers commented 2 months ago

Is your feature request related to a problem? Please describe.

The ScalaTest pages suggest using "FeatureSpec style for acceptance testing". We are migrating to using Metals but this is the one testing style not supported by the ScalaTest integration. Whole Spec's can be run/debugged but there is no breakdown of Scenario's.

Describe the solution you'd like

Support for AnyFeatureSpec in the ScalaTest integration. This would list specific Scenarios in the TESTING tab and allow a specific Scenario to be run/debugged. Understand that this might be because Scenarios are/can be held in Features so aren't necessarily a flat list. IntelliJ plugin resolves this by flattening them so each Scenario name is prefixed with it's Feature name.

Describe alternatives you've considered

Currently using a script which runs the test using sub-text filtering. e.g.
mvn test -Dsuites="some.package.MySpec filter-sub-text" but this doesn't support debugging.

Additional context

No response

Search terms

scalatest FeatureSpec AnyFeatureSpec

tgodzik commented 2 months ago

Thanks for reporting! If anyone wants to take a look the code responsible is here:

https://github.com/scalameta/metals/blob/main/metals/src/main/scala/scala/meta/internal/metals/testProvider/frameworks/ScalatestTestFinder.scala