foneandrew / ruby-spec-runner

Run specific rspec & minitest tests from within vscode
MIT License
9 stars 3 forks source link

Mark group as passed if all inside tests passed #3

Closed Hanaffi closed 5 months ago

Hanaffi commented 1 year ago

Hi, Thanks so much for your efforts!

I think it would be so cool if the extension marks the group (describe for example) as passed if all inside tests passed.

image

foneandrew commented 1 year ago

Hey I like this idea. I have looked into it for feasibility but unfortunately it doesn't look doable for the way the extension currently works. Basically we rely on the json output from rspec and use that to match test results to lines in the file. The output does not provide a reliable way for us to match each example with all its parent context and describe blocks. To do it manually would involve parsing all the blocks in the file I think which is a bit too extreme for what this extension aims for.

If you are wanting to be able to see more information about which tests are passing or failing for a whole file, you can see all test results in the vscode ruler. There is some configuration around this too. So while we're looking at the top of the file, in the ruler on the right we can see that there is one failed test along with an exception underneath it in the middle of the file.

Screenshot 2023-04-05 at 9 02 04 AM

Leaving the issue open for now in case you want to discuss further, or have an idea of how we can do it