Visual Studio Code - settings.json - test discovery error

44 Views Asked by At

I have a C# project with Specflow in Visual Studio, and I want learn to run the tests in Visual Studio Code.

Installed extensions and can run the feature file tests, but I want to use an appsetting.qa.json file (we also have one for the dev environment).

So here is what I tried in the settings.json for the project:

{
    "dotnet-test-explorer.testProjectPath": "\\BDTEngineTests\\BDTEngineTests\\BDTEngineTests.csproj",
    "dotnet-test-explorer.testArguments": " --settings \\BDTEngineTests\\BDTEngineTests\\appsettings.qa2.json",
    "dotnet.defaultSolution": "BDT.sln"
}

That second line causes a failure in test discovery.

The error shown is: [ERROR] Error while executing dotnet test -t -v=q --settings BDTEngineTests/BDTEngineTests/appsettings.qa2.json

When I remove the second line, I can run tests fine, but the test values are not what I want because it's using default values.

enter image description here

0

There are 0 best solutions below