microsoft / microsoft/nodejstools
TestContainersUpdated events are not sent on project open/close
@armanio123 is already working on this.
Since Jun 27, 2019.
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behavior
The TestContainerDiscoverer class is responsible for notifying the TestWindow of containers where tests should be discovered. It should call the TestContainersUpdated event whenever tests could potentially have changed.
My expectation is that OnProjectLoaded and OnProjectUnloaded should send the TestContainersUpdated event.
Actual Behavior
If you would put a breakpoint you can see that the OnTestContainersChanged is called, but the if condition evaluates to false and the event isn't actually sent, meaning that tests don't get removed on project close and don't get discovered on project open.
- NTVS Version: 1.5.10610.1 Commit Hash:529a87de2769e143655e31ea81795c42e5775ef8
- Visual Studio Version: 16.2 preview 4
- Node.js Version: 8.1.4
Steps to Reproduce
- Open a nodejs project
- Run build to discover tests
- Unload the project
- If the event would have been sent successfully the tests for the unloaded project should disappear
In the OnProjectUnloaded method the project is removed from knownProjects and this makes the if condition always fail, whereas in the OnProjectLoaded method the newly created project has HasRequestedContainers set to false making the if condition always fail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.