Skip to content

Commit

Permalink
Enabled Conservative Mode (#491)
Browse files Browse the repository at this point in the history
Co-authored-by: Gáspár Nagy <[email protected]>
  • Loading branch information
DerAlbertCom and gasparnagy authored Feb 24, 2025
1 parent 4ee2734 commit 5cac594
Show file tree
Hide file tree
Showing 8 changed files with 418 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

## Bug fixes:
* Fix: Microsoft.Extensions.DependencyInjection.ReqnrollPlugin, the plugin was only searching for [ScenarioDependencies] in assemblies with step definitions (#477)
* Fix: xUnit Conservative Mode is not supported together with xUnit v2 (#473)

*Contributors of this release (in alphabetical order):* @304NotModified, @obligaron
*Contributors of this release (in alphabetical order):* @304NotModified, @DerAlbertCom, @obligaron

# v2.3.0 - 2025-02-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<group targetFramework=".NETStandard2.0">
<dependency id="Reqnroll" version="[$version$]" />
<dependency id="Reqnroll.Tools.MsBuild.Generation" version="[$version$]" />
<dependency id="xunit.core" version="2.4.2" />
<dependency id="xunit.core" version="2.8.1" />
<dependency id="Xunit.SkippableFact" version="1.4.13" />
</group>
<group targetFramework=".NETFramework4.6.2">
<dependency id="Reqnroll" version="[$version$]" />
<dependency id="Reqnroll.Tools.MsBuild.Generation" version="[$version$]" />
<dependency id="xunit.core" version="2.4.2" />
<dependency id="xunit.core" version="2.8.1" />
<dependency id="Xunit.SkippableFact" version="1.4.13" />
</group>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.core" Version="2.4.2" />
<PackageReference Include="xunit.core" Version="2.8.1" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Contains Code from https://github.com/xunit/xunit/blob/v2/src/common/ExceptionExtensions.cs
// originally published under Apache 2.0 license
// Xunit v2 will be not developed further
using System;
using System.Reflection;

namespace Reqnroll.xUnit.ReqnrollPlugin.Runners;

static class ExceptionExtensions
{
/// <summary>
/// Unwraps an exception to remove any wrappers, like <see cref="TargetInvocationException"/>.
/// </summary>
/// <param name="ex">The exception to unwrap.</param>
/// <returns>The unwrapped exception.</returns>
public static Exception Unwrap(this Exception ex)
{
while (true)
{
var tiex = ex as TargetInvocationException;
if (tiex == null) return ex;

ex = tiex.InnerException;
}
}
}
Loading

0 comments on commit 5cac594

Please sign in to comment.