You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While executing unit tests in a generated unit test project from the command line an exception occurs.
In my case, the unit tests are all C# tests, but the referenced Asp.Net core project contains TypeScript Mocha tests.
Note, I was able to override the TestFrameworks path using a RunSettings file, however it would be desirable for this not to be required.
Expected Behavior
Unit tests to be executed without an exception and without requiring a runsettings file.
Actual Behavior
An example of the output:
Microsoft (R) Test Execution Command Line Tool Version 16.11.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
An exception occurred while invoking executor 'executor://nodejstestexecutor/v1': Unable to find test framework folder. Tried: "C:\dev\AspNetCoreTest\Active\Web\UnitTests\AspNetCoreTest.Tests\bin\Debug\netcoreapp3.1\..\_common\TestFrameworks"
Stack trace:
at Microsoft.NodejsTools.TestFrameworks.TestFrameworkDirectories.GetFrameworkDirectories(String testFrameworkRoot)
at Microsoft.NodejsTools.TestAdapter.TestFrameworks.FrameworkDiscoverer..ctor(String testFrameworkRootDirectory)
at Microsoft.NodejsTools.TestAdapter.TestExecutorWorker..ctor(IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.NodejsTools.TestAdapter.NetCoreTestExecutor.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension`2 executor, Tuple`2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests)
Passed QueryForJsonStringAsyncTest [810 ms]
Passed GetWhereClauseTest [68 ms]
Passed GetCriteriaTest [< 1 ms]
Passed SimplifyCriteriaTest [1 ms]
Results File: C:\dev\AspNetCoreTest\Active\Web\UnitTests\AspNetCoreTest.Tests\bin\Debug\netcoreapp3.1\TestResults\ME_MYBOX_2021-08-16_17_50_50.trx
Test Run Failed.
Total tests: 4
Passed: 4
Total time: 1.5941 Seconds
The problem seems to be from the TestFrameworkDirectories class's GetTestframeworkFolderRoot method using the unit test dll's location and then appending ..\_common to the path.
While executing unit tests in a generated unit test project from the command line an exception occurs.
In my case, the unit tests are all C# tests, but the referenced Asp.Net core project contains TypeScript Mocha tests.
Note, I was able to override the TestFrameworks path using a RunSettings file, however it would be desirable for this not to be required.
Expected Behavior
Unit tests to be executed without an exception and without requiring a runsettings file.
Actual Behavior
An example of the output:
The problem seems to be from the TestFrameworkDirectories class's GetTestframeworkFolderRoot method using the unit test dll's location and then appending ..\_common to the path.
Here is the command line I executed:
Here is the RunSettings file that I used to force the path:
Steps to Reproduce
The text was updated successfully, but these errors were encountered: