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
Copy file name to clipboardExpand all lines: docs/javascript/unit-testing-javascript-with-visual-studio.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Unit testing JavaScript and TypeScript"
3
3
description: Explore unit testing support in Visual Studio for JavaScript and TypeScript code by using the Node.js Tools for Visual Studio.
4
-
ms.date: "7/31/2025"
4
+
ms.date: "8/6/2025"
5
5
ms.topic: "how-to"
6
6
ms.devlang: javascript
7
7
author: "mikejo5000"
@@ -115,7 +115,7 @@ The following example is based on the TypeScript React project template provided
115
115
> For TypeScript, don't use the `outfile` option in *tsconfig.json*, because Test Explorer won't be able to find your unit tests. You can use the `outdir` option, but make sure that configuration files such as `package.json` and `tsconfig.json` are in the project root.
116
116
117
117
> [!IMPORTANT]
118
-
> If the output from **Tests** in the Output window shows a `ReadOnlySpan` error during test discovery, use this workaround for a known [MSBuild issue](https://github.com/dotnet/msbuild/issues/7873). Open the folder, *Program Files\Microsoft Visual Studio\2022\\<version\>\Common7\IDE\Extensions\TestPlatform*, and rename *System.Memory.dll* to a different name. This fix enables test discovery.
118
+
> If the output from **Tests** in the Output window shows a `ReadOnlySpan` error during test discovery, use the following workaround for a known [MSBuild issue](https://github.com/dotnet/msbuild/issues/7873). Open the folder, *Program Files\Microsoft Visual Studio\2022\\<version\>\Common7\IDE\Extensions\TestPlatform*, and rename *System.Memory.dll* to a different name. This fix enables test discovery.
119
119
120
120
### Run tests (.esproj)
121
121
@@ -133,6 +133,16 @@ For some unit test frameworks, unit tests are typically run against the generate
133
133
> [!NOTE]
134
134
> Profiling tests and code coverage aren't currently supported.
135
135
136
+
## Run unit tests from the command line for a CLI-based project (.esproj)
137
+
138
+
You can run unit tests directly from the command line for your unit test framework the same way you would if you weren't using Visual Studio.
139
+
140
+
You may also choose to run the tests from the command line using *vstest.console*. For example, you may want to use vstest.console to maintain consistency with C# unit tests, or to run in Azure DevOps. Use the following command, but replace `MyProj` with your project name.
@@ -356,7 +366,7 @@ The following example is based on the ASP.NET Core Model-View-Controller project
356
366
357
367
::: moniker range="vs-2022"
358
368
> [!IMPORTANT]
359
-
> If the output from **Tests** in the Output window shows a `ReadOnlySpan` error during test discovery, use this workaround for a known [MSBuild issue](https://github.com/dotnet/msbuild/issues/7873). Open the folder, *Program Files\Microsoft Visual Studio\2022\\<version\>\Common7\IDE\Extensions\TestPlatform*, and rename *System.Memory.dll* to a different name. This fix enables test discovery.
369
+
> If the output from **Tests** in the Output window shows a `ReadOnlySpan` error during test discovery, use the following workaround for a known [MSBuild issue](https://github.com/dotnet/msbuild/issues/7873). Open the folder, *Program Files\Microsoft Visual Studio\2022\\<version\>\Common7\IDE\Extensions\TestPlatform*, and rename *System.Memory.dll* to a different name. This fix enables test discovery.
0 commit comments