Skip to content

Commit 132f9fc

Browse files
committed
updates
1 parent 8e10888 commit 132f9fc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/javascript/unit-testing-javascript-with-visual-studio.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ The following example is based on the TypeScript React project template provided
107107
});
108108
```
109109

110-
::: moniker range="vs-2022"
111-
> [!IMPORTANT]
112-
> Due to 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.
113-
::: moniker-end
114-
115110
1. Open Test Explorer (choose **Test** > **Test Explorer**) and Visual Studio discovers and displays tests. If tests are not showing initially, then rebuild the project to refresh the list.
116111

117112
![Screenshot of Test Explorer test discovery (.esproj).](../javascript/media/vs-2022/unit-tests-esproj-discovery.png)
118113

119114
> [!NOTE]
120115
> For TypeScript, do not 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.
121116
117+
::: moniker range="vs-2022"
118+
> [!IMPORTANT]
119+
> 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.
120+
::: moniker-end
121+
122122
### Run tests (.esproj)
123123

124124
You can run the tests by clicking the **Run All** link in Test Explorer. Or, you can run tests by selecting one or more tests or groups, right-clicking, and selecting **Run** from the shortcut menu. Tests run in the background, and Test Explorer automatically updates and shows the results. Furthermore, you can also debug selected tests by right-clicking and selecting **Debug**.
@@ -349,18 +349,18 @@ The following example is based on the ASP.NET Core Model-View-Controller project
349349
})
350350
```
351351

352-
::: moniker range="vs-2022"
353-
> [!IMPORTANT]
354-
> Due to 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.
355-
::: moniker-end
356-
357352
1. Open Test Explorer (choose **Test** > **Windows** > **Test Explorer**) and Visual Studio discovers and displays tests. If tests are not showing initially, then rebuild the project to refresh the list. The following illustration shows the Jest example, with two different unit test files.
358353

359354
![Screenshot of Test Explorer test discovery (ASP.NET Core).](../javascript/media/vs-2022/unit-tests-asp-dotnet-discovery.png)
360355

361356
> [!NOTE]
362357
> For TypeScript, do not 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.
363358
359+
::: moniker range="vs-2022"
360+
> [!IMPORTANT]
361+
> 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.
362+
::: moniker-end
363+
364364
### Run tests (ASP.NET Core)
365365

366366
You can run the tests by clicking the **Run All** link in Test Explorer. Or, you can run tests by selecting one or more tests or groups, right-clicking, and selecting **Run** from the shortcut menu. Tests run in the background, and Test Explorer automatically updates and shows the results. Furthermore, you can also debug selected tests by right-clicking and selecting **Debug**.

0 commit comments

Comments
 (0)