pester / vscode-adapter

Run PowerShell Pester Tests with Visual Studio Code
MIT License
58 stars 14 forks source link

Tests will run on wrong file if discovery is done with expanded files first #146

Closed JustinGrote closed 1 year ago

JustinGrote commented 1 year ago
  1. Run extension with basic tests
  2. Set up the UI so that test explorer has all tests pre-expanded
  3. Reload and click the test tab so that all tests discover
  4. Run the last test, the test data will have the file URI of the wrong test

This is probably a carryover value during discovery

JustinGrote commented 1 year ago

The data comes back from the PesterInterface correct, so somewhere in testcontroller the data is getting mapped to the wrong testitem perhaps.

2023-06-28 08:42:38.026 [trace] Received discovery item from PesterInterface:

{"type":"Test","id":"C:\\USERS\\JGROTE\\PROJECTS\\VSCODE-ADAPTER\\SAMPLE\\TESTS\\TRUE.TESTS.PS1>>SIMPLETEST>>TRUE SHOULD BE TRUE","error":null,"file":"C:\\Users\\jgrote\\Projects\\vscode-adapter\\sample\\Tests\\True.Tests.ps1","startLine":1,"endLine":3,"label":"True should be true","result":"Failed","duration":0,"durationDetail":"(0ms|0ms)","message":null,"expected":null,"actual":null,"targetFile":null,"targetLine":-1,"parent":"C:\\USERS\\JGROTE\\PROJECTS\\VSCODE-ADAPTER\\SAMPLE\\TESTS\\TRUE.TESTS.PS1>>SIMPLETEST","tags":[]}