Table of Contents

Core Framework v2 2.8.1 2024 May 24

Today, we're shipping three new releases:

  • xUnit.net Core Framework v2 2.8.1
  • xUnit.net Analyzers 1.14.0 (release notes)
  • xUnit.net Visual Studio adapter 2.8.1 (release notes)

It's been 1 month since the release of 2.8.0.

As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉

Release Notes

These release notes are a comprehensive list of changes from 2.8.0 to 2.8.1.

Core Framework

  • We have updated the message provided when a fixture used in IClassFixture<> throws in its constructor. The new message more clearly illustrates what happened ("Class fixture type 'TypeName' threw in its constructor"). xunit/xunit#2927

  • BUG: We fixed an issue when custom attributes derived from FactAttribute threw in one of their properties (like Skip), the error was not being properly surfaced.

Assertion Library

  • We have updated Assert.Matches and Assert.DoesNotMatch so that the regular expression value will be correctly syntax colored by Visual Studio.

    Assert.Matches

Runners

  • We have added the ability to show output from ITestOutputHelper immediately while a test is running rather than waiting for the test to complete. (Note: This can add significant noise to the output while running tests, so we recommend you only temporarily enable this when attempting to track down an issue with a misbehaving test that never finishes/takes a long time to finish.)

    • We have added a showLiveOutput configuration item
    • We have added a ShowLiveOutput RunSettings item
    • The console runner has added a -showliveoutput switch
    • The MSBuild runner has added a ShowLiveOutput="true" property

    Note that dotnet test usually hides all output from xUnit.net unless you add the --logger "console;verbosity=normal" switch. To see output when running tests in Visual Studio Test Explorer, check the Output window's "Tests" tab. Screenshots are shown in the linked issue. xunit/visualstudio.xunit#408

Runner Utility

  • We have obsoleted the two overloads of AssemblyRunner.Start() and replaced it with one which takes a start options structure (Xunit.Runners.AssemblyRunnerStartOptions). The number of parameters had grown unwieldy, and adding new ones when all parameters were optional was causing overload resolution problems. The obsoleted overloads will be removed in v3.