Skip to content

Commit

Permalink
Add migration guide
Browse files Browse the repository at this point in the history
Add a migration guide for moving from xunit v2 to v3.
  • Loading branch information
martincostello committed Dec 20, 2024
1 parent e39e9bf commit 3ce3b7a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ See below for links to more examples:
- [Unit tests][example-unit-tests]
- [Integration tests for an ASP.NET Core HTTP application][example-integration-tests]

## Migrating to xunit v3

[Xunit v3][xunit-v3-whats-new] contains many major architectural changes which means the same package
that supports logging for xunit v2 cannot be used with xunit v3. The equivalent NuGet package to support
logging for xunit v3 is the new `MartinCostello.Logging.XUnit.v3` package.

To migrate usage of `MartinCostello.Logging.XUnit` to `MartinCostello.Logging.XUnit.v3` for xunit v3:

1. Follow the relevant steps to migrate any test projects from [xunit v2 to v3][xunit-v3-migration].
- The most relevant change in xunit v3 is that the `ITestOutputHelper` type has moved from the `Xunit.Abstractions` namespace to `Xunit`.
1. Change any package references from `MartinCostello.Logging.XUnit` to `MartinCostello.Logging.XUnit.v3`.

```diff
- <PackageReference Include="MartinCostello.Logging.XUnit" Version="0.5.0" />
+ <PackageReference Include="MartinCostello.Logging.XUnit.v3" Version="0.5.0" />
```

## Feedback

Any feedback or issues can be added to the issues for this project in [GitHub][issues].
Expand Down Expand Up @@ -130,3 +147,5 @@ cd xunit-logging
[repo]: https://github.com/martincostello/xunit-loggingE "This project on GitHub.com"
[serilog]: https://serilog.net/ "Serilog website"
[serilog-sinks-xunit]: https://github.com/trbenning/serilog-sinks-xunit "Serilog.Sinks.XUnit on GitHub"
[xunit-v3-migration]: https://xunit.net/docs/getting-started/v3/migration#migrating-to-v3-packages "Migrating from xunit v2 to v3"
[xunit-v3-whats-new]: https://xunit.net/docs/getting-started/v3/whats-new "What's New in v3"

0 comments on commit 3ce3b7a

Please sign in to comment.