Skip to content

Commit c8b8df3

Browse files
dependabot[bot]gunndabadclaude
authored
Bump xunit.v3 from 3.2.2 to 4.0.0 (#561)
* Bump xunit.v3 from 3.2.2 to 4.0.0 --- updated-dependencies: - dependency-name: xunit.v3 dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Use MTP * Specify paths to test projects in justfile * Pre-enumerate theories in the unit tests The custom tag helper discoverer re-wraps each discovered case in a TagHelperTestCase that carries its data row, so a delay-enumerated theory case arrives with no arguments and the test fails. The VSTest adapter pre-enumerated theories for us; the MTP runner does not, so ask for it explicitly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Gunn <james@gunn.io> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 1400a29 commit c8b8df3

5 files changed

Lines changed: 13 additions & 4 deletions

File tree

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"sdk": {
33
"version": "10.0.100"
4+
},
5+
"test": {
6+
"runner": "Microsoft.Testing.Platform"
47
}
58
}

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ test *ARGS: (unit-tests ARGS) (integration-tests ARGS) (package-tests ARGS)
3333

3434
# Run the unit tests
3535
unit-tests *ARGS:
36-
@dotnet test tests/GovUk.Frontend.AspNetCore.Tests/ {{ARGS}}
36+
@dotnet test --project tests/GovUk.Frontend.AspNetCore.Tests/GovUk.Frontend.AspNetCore.Tests.csproj {{ARGS}}
3737

3838
# Run the integration tests
3939
integration-tests *ARGS:
40-
@dotnet test tests/GovUk.Frontend.AspNetCore.IntegrationTests/ {{ARGS}}
40+
@dotnet test --project tests/GovUk.Frontend.AspNetCore.IntegrationTests/GovUk.Frontend.AspNetCore.IntegrationTests.csproj {{ARGS}}
4141

4242
# Run the package tests; these pack the library and build throwaway projects against it
4343
package-tests *ARGS:
44-
@dotnet test tests/GovUk.Frontend.AspNetCore.PackageTests/ {{ARGS}}
44+
@dotnet test --project tests/GovUk.Frontend.AspNetCore.PackageTests/GovUk.Frontend.AspNetCore.PackageTests.csproj {{ARGS}}
4545

4646
# Format the C# code
4747
format *ARGS:

tests/GovUk.Frontend.AspNetCore.PackageTests/GovUk.Frontend.AspNetCore.PackageTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>
23-
<PackageReference Include="xunit.v3" Version="3.2.2" />
23+
<PackageReference Include="xunit.v3" Version="4.0.0" />
2424
</ItemGroup>
2525

2626
<!-- Deliberately no ProjectReference to the library: these tests must only ever see it through the

tests/GovUk.Frontend.AspNetCore.Tests/TagHelpers/TagHelperTestCase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public override async ValueTask<IReadOnlyCollection<IXunitTestCase>> Discover(
4545
}
4646
}
4747

48+
// Every discovered case is re-wrapped as a plain TagHelperTestCase, which carries its data row with it, so the
49+
// theories have to be pre-enumerated by the time we see them; xunit.runner.json turns that on for the assembly.
4850
public class TagHelperTheoryDiscoverer : TheoryDiscoverer
4951
{
5052
public override async ValueTask<IReadOnlyCollection<IXunitTestCase>> Discover(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
3+
"preEnumerateTheories": true
4+
}

0 commit comments

Comments
 (0)