Skip to content

Commit a4b1086

Browse files
committed
acrolinx edits
1 parent 564805b commit a4b1086

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ The supported frameworks are:
3333
::: moniker-end
3434

3535
::: moniker range="<=vs-2019"
36-
If your favorite framework is not supported, see [Add support for a unit test framework](#addingFramework) for information on adding support.
36+
If your favorite framework isn't supported, see [Add support for a unit test framework](#addingFramework) for information on adding support.
3737
::: moniker-end
3838

3939
::: moniker range=">=vs-2022"
4040
## Write unit tests for a CLI-based project (.esproj)
4141

42-
The [CLI-based projects](../javascript/javascript-in-vs-2022.md#project-templates) supported in Visual Studio 2022 work with Test Explorer. Vitest is the built-in test framework for React and Vue projects (previously Jest), and Karma and Jasmine is used for Angular projects. By default, you will be able to run the default tests provided by each framework, as well as any additional tests you write. Just hit the **Run** button in Test Explorer. If you don’t already have Test Explorer open, you can find it by selecting **Test** > **Test Explorer** in the menu bar.
42+
The [CLI-based projects](../javascript/javascript-in-vs-2022.md#project-templates) supported in Visual Studio 2022 work with Test Explorer. Vitest is the built-in test framework for React and Vue projects (previously Jest), and Karma and Jasmine is used for Angular projects. By default, you'll be able to run the default tests provided by each framework, as well as any additional tests you write. Just hit the **Run** button in Test Explorer. If you don’t already have Test Explorer open, you can find it by selecting **Test** > **Test Explorer** in the menu bar.
4343

4444
To run unit tests from the command-line, right-click the project in Solution Explorer, choose **Open in Terminal**, and run the command specific to the test type.
4545

@@ -107,12 +107,12 @@ The following example is based on the TypeScript React project template provided
107107
});
108108
```
109109

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.
110+
1. Open Test Explorer (choose **Test** > **Test Explorer**) and Visual Studio discovers and displays tests. If tests aren't showing initially, then rebuild the project to refresh the list.
111111

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

114114
> [!NOTE]
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.
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.
116116
117117
> [!IMPORTANT]
118118
> 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.
@@ -131,7 +131,7 @@ For some unit test frameworks, unit tests are typically run against the generate
131131
> In most TypeScript scenarios, you can debug a unit test by setting a breakpoint in TypeScript code, right-clicking a test in Test Explorer, and choosing **Debug**. In more complex scenarios, such as some scenarios that use source maps, you may have difficulty hitting breakpoints in TypeScript code. As a workaround, try using the `debugger` keyword.
132132
133133
> [!NOTE]
134-
> Profiling tests and code coverage are not currently supported.
134+
> Profiling tests and code coverage aren't currently supported.
135135
136136
::: moniker-end
137137

@@ -347,12 +347,12 @@ The following example is based on the ASP.NET Core Model-View-Controller project
347347
})
348348
```
349349

350-
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.
350+
1. Open Test Explorer (choose **Test** > **Windows** > **Test Explorer**) and Visual Studio discovers and displays tests. If tests aren't showing initially, then rebuild the project to refresh the list. The following illustration shows the Jest example, with two different unit test files.
351351

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

354354
> [!NOTE]
355-
> 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.
355+
> 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.
356356
357357
::: moniker range="vs-2022"
358358
> [!IMPORTANT]
@@ -373,7 +373,7 @@ For some unit test frameworks, unit tests are typically run against the generate
373373
> In most TypeScript scenarios, you can debug a unit test by setting a breakpoint in TypeScript code, right-clicking a test in Test Explorer, and choosing **Debug**. In more complex scenarios, such as some scenarios that use source maps, you may have difficulty hitting breakpoints in TypeScript code. As a workaround, try using the `debugger` keyword.
374374
375375
> [!NOTE]
376-
> Profiling tests and code coverage are not currently supported.
376+
> Profiling tests and code coverage aren't currently supported.
377377
378378
::: moniker range="<=vs-2019"
379379
## <a name="addingFramework"></a>Add support for a unit test framework
@@ -402,7 +402,7 @@ Discovery of available test frameworks occurs at Visual Studio start. If a frame
402402

403403
## Unit tests in .NET Framework
404404

405-
You are not limited to writing unit tests in just your Node.js and ASP.NET Core projects. When you add the TestFramework and TestRoot properties to any C# or Visual Basic project, those tests will be enumerated and you can run them using the Test Explorer window.
405+
You aren't limited to writing unit tests in just your Node.js and ASP.NET Core projects. When you add the TestFramework and TestRoot properties to any C# or Visual Basic project, those tests will be enumerated and you can run them using the Test Explorer window.
406406

407407
To enable this, right-click the project node in the Solution Explorer, choose **Unload Project**, and then choose **Edit Project**. Then in the project file, add the following two elements to a property group.
408408

@@ -470,12 +470,12 @@ property in the **Properties** window is set to the correct test framework for y
470470
> [!NOTE]
471471
> The unit test options will take preference over the settings for individual files.
472472
473-
After opening Test Explorer (choose **Test** > **Windows** > **Test Explorer**), Visual Studio discovers and displays tests. If tests are not showing initially, then rebuild the project to refresh the list.
473+
After opening Test Explorer (choose **Test** > **Windows** > **Test Explorer**), Visual Studio discovers and displays tests. If tests aren't showing initially, then rebuild the project to refresh the list.
474474

475475
![Screenshot of Test Explorer.](../javascript/media/UnitTestsDiscoveryMocha.png)
476476

477477
> [!NOTE]
478-
> For TypeScript, do not use the `outdir` or `outfile` option in *tsconfig.json*, because Test Explorer won't be able to find your unit tests.
478+
> For TypeScript, don't use the `outdir` or `outfile` option in *tsconfig.json*, because Test Explorer won't be able to find your unit tests.
479479
480480
## Run tests (Node.js)
481481

0 commit comments

Comments
 (0)