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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,18 +107,18 @@ The following example is based on the TypeScript React project template provided
107
107
});
108
108
```
109
109
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
-
115
110
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.
116
111
117
112

118
113
119
114
> [!NOTE]
120
115
> 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.
121
116
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
+
122
122
### Run tests (.esproj)
123
123
124
124
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
349
349
})
350
350
```
351
351
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
-
357
352
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.
358
353
359
354

360
355
361
356
> [!NOTE]
362
357
> 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.
363
358
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
+
364
364
### Run tests (ASP.NET Core)
365
365
366
366
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