How do I debug a test
  • 24 Nov 2022
  • 1 Minute to read
  • Contributors
  • Comment
  • Dark
    Light
  • PDF

How do I debug a test

  • Comment
  • Dark
    Light
  • PDF

Article Summary

The video below will give you a short walk through on how to debug a test from the terminal in vs code

Steps

Add a breakpoint as needed before running the test.

  1. In terminal run the following:
$env:VSTEST_HOST_DEBUG=1
  1. Then run the tests with the appropriate dotnet test command

Note you might want to run an individual test as shown below if you want to focus on one test.

dotnet test --filter FullyQualifiedName=logicapp.testing.acceptancetests.Features.Echo.MsTest.Tests.MsTest_Echo_GreenPath --logger:"console;verbosity=normal"
  1. When finished set the environment variable back to 0 to turn off debugging
$env:VSTEST_HOST_DEBUG=0

Was this article helpful?