Remove "Shadow copying" section from integration testing guide (#23092)
* Remove "Shadow copying" section from integration testing guide * Delete xunit.runner.json * Keep shadow copying section but mention when it's needed Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>pull/23594/head
parent
0252159b15
commit
e3a9128588
|
@ -327,9 +327,9 @@ The `WebApplicationFactory` constructor infers the app [content root](xref:funda
|
|||
|
||||
## Disable shadow copying
|
||||
|
||||
Shadow copying causes the tests to execute in a different directory than the output directory. For tests to work properly, shadow copying must be disabled. The [sample app](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/test/integration-tests/samples) uses xUnit and disables shadow copying for xUnit by including an `xunit.runner.json` file with the correct configuration setting. For more information, see the [xUnit documentation](https://xunit.net/docs/configuration-files).
|
||||
Shadow copying causes the tests to execute in a different directory than the output directory. If your tests rely on loading files relative to `Assembly.Location` and you encounter issues, you might have to disable shadow copying.
|
||||
|
||||
Add the `xunit.runner.json` file to root of the test project with the following content:
|
||||
To disable shadow copying when using xUnit, create a `xunit.runner.json` file in your test project directory, with the [correct configuration setting](https://xunit.net/docs/configuration-files#shadowCopy):
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"shadowCopy": false
|
||||
}
|
Loading…
Reference in New Issue