formulahendry / formulahendry/vscode-dotnet-test-explorer

[Enhancement] Expecto - run individual tests, avoid finding tests twice

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
208
Forks
93
PR merge metrics
No merged PRs in 30d

Description

I'm trying out the Expecto example tests in the Sample.fs that's added via dotnet new expecto (using core 3 preview 9, and latest version of the dotnet test explorer plugin)

I was actually pleasantly surprised that Expecto tests are found at all (it's not listed as a feature) but there's potential for improvement.

Attempting to run a single Expecto test just prints an error to the Text Explorer output, like:
[WARNING] Could not find a matching test directory for test ExTests.samples/contains things

They cannot be run at the project level either, only via Run All. (That's likely the reason why #231 happens. I'm not really surprised by this, because Expecto's tests are a list of functions rather than functions on a class/module with attributes marking them. But I'm pleased that they're picked up and listed individually at all.)

Another weird behaviour is that when discovering tests, often a second copy of the Expecto tests appears in the test explorer, not grouped under a project. (Sometimes the Expecto tests also appear properly under their project, sometimes not.)

![image](https://user-images.githubusercontent.com/5440153/65382318-fd14ee00-dd45-11e9-9f82-408adec46806.png)

Running all tests usually removes the extra list items, but not always. Once it instead resulted in two copies of each Expecto test being listed in that project.

The very first time I did test discovery for my newly created projects (I also have a project of F# xUnit tests), all the tests showed up four (4) times in the test explorer list. That went away when I restarted VSCode and hasn't happened since.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.