Skip to content

Commit ae8f020

Browse files
authored
Merge pull request #1775 from bUnit-dev/release/v2.0
Release of new major version v2.0
2 parents 4debd7f + 80d6f3f commit ae8f020

File tree

468 files changed

+6166
-12492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

468 files changed

+6166
-12492
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"features": {
88
"ghcr.io/devcontainers/features/dotnet:2": {
99
"version": "latest",
10-
"additionalVersions": "8.0,7.0,6.0,5.0,3.1"
10+
"additionalVersions": "8.0"
1111
}
1212
},
1313

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ dotnet_diagnostic.S1075.severity = suggestion # S1075: URIs should not be hardco
454454
dotnet_diagnostic.S1186.severity = suggestion # S1186: Methods should not be empty
455455
dotnet_diagnostic.S2292.severity = suggestion # S2292: Trivial properties should be auto-implemented
456456
dotnet_diagnostic.S3267.severity = suggestion # S3267: Convert foreach loop to LINQ query
457+
dotnet_diagnostic.S2743.severity = suggestion # S2743: A static field in a generic type is not shared among instances
457458
dotnet_diagnostic.S4158.severity = none # BUGGY with C#9 code - doesnt understand local methods
458459

459460
# Razor specific rules
@@ -491,6 +492,7 @@ dotnet_diagnostic.CA1062.severity = none # CA1062: Validate arguments of public
491492
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
492493
dotnet_diagnostic.CA1812.severity = none # CA1812: Avoid uninstantiated internal classes - components under test are never instantiated directly.
493494
dotnet_diagnostic.CA1822.severity = suggestion # CA1822: Mark members as static
495+
dotnet_diagnostic.CA1859.severity = none # CA1859: Change return type of method
494496
dotnet_diagnostic.CA2007.severity = none # CA2007: Consider calling ConfigureAwait on the awaited task
495497

496498
# Microsoft - FxCop

.github/workflows/ci.yml

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
push:
55
branches:
66
- main
7-
- v2
87
paths:
98
- 'src/**'
109
- 'tests/**'
10+
- 'docs/**'
1111

1212
pull_request:
1313
types:
@@ -18,7 +18,7 @@ on:
1818
workflow_dispatch:
1919

2020
concurrency:
21-
group: verification-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
21+
group: ci-${{ github.workflow }}-${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2') && github.run_id || github.event.pull_request.number || github.ref }}
2222
cancel-in-progress: true
2323

2424
env:
@@ -35,17 +35,18 @@ jobs:
3535
create-nuget:
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939
with:
4040
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
4141

4242
# Install the .NET SDK indicated in the global.json file
4343
- name: ⚙️ Setup dotnet versions
44-
uses: actions/setup-dotnet@v4
44+
uses: actions/setup-dotnet@v5
4545
with:
4646
dotnet-version: |
4747
8.0.x
4848
9.0.x
49+
10.0.x
4950
5051
- name: ⚙️ Setup GIT versioning
5152
uses: dotnet/[email protected]
@@ -71,10 +72,9 @@ jobs:
7172
# Create the NuGet package in the folder from the environment variable NuGetDirectory
7273
- run: |
7374
dotnet pack src/bunit/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
74-
dotnet pack src/bunit.core/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
75-
dotnet pack src/bunit.web/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7675
dotnet pack src/bunit.template/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7776
dotnet pack src/bunit.web.query/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
77+
dotnet pack src/bunit.generators/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7878
7979
# Publish the NuGet package as an artifact, so they can be used in the following jobs
8080
- uses: actions/upload-artifact@v4
@@ -90,9 +90,9 @@ jobs:
9090
needs: [ create-nuget ]
9191
steps:
9292
- name: Setup .NET
93-
uses: actions/setup-dotnet@v4
93+
uses: actions/setup-dotnet@v5
9494

95-
- uses: actions/download-artifact@v4
95+
- uses: actions/download-artifact@v5
9696
with:
9797
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
9898
path: ${{ env.NUGET_DIRECTORY }}
@@ -112,30 +112,30 @@ jobs:
112112
strategy:
113113
fail-fast: false
114114
matrix:
115-
os: [ubuntu-latest, macos-13, windows-latest]
116-
framework: [net8.0, net9.0]
115+
os: [ubuntu-latest, macos-latest, windows-latest]
117116
runs-on: ${{ matrix.os }}
118117

119118
steps:
120119
- name: 🛒 Checkout repository
121-
uses: actions/checkout@v4
120+
uses: actions/checkout@v5
122121
with:
123122
fetch-depth: 0
124123

125124
- name: ⚙️ Setup dotnet versions
126-
uses: actions/setup-dotnet@v4
125+
uses: actions/setup-dotnet@v5
127126
with:
128127
dotnet-version: |
129128
8.0.x
130129
9.0.x
130+
10.0.x
131131
132132
- name: ⚙️ Restore packages and tools
133133
run: |
134134
dotnet restore
135135
dotnet tool restore
136136
137137
- name: 🧪 Run unit tests
138-
run: dotnet test -c release --no-restore -f ${{ matrix.framework }}
138+
run: dotnet test -c release --no-restore
139139

140140
- name: 📛 Upload hang- and crash-dumps on test failure
141141
if: success() || failure()
@@ -151,17 +151,17 @@ jobs:
151151
runs-on: ubuntu-latest
152152
needs: [ create-nuget ]
153153
steps:
154-
- uses: actions/checkout@v4
154+
- uses: actions/checkout@v5
155155
with:
156156
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
157157

158158
- name: ⚙️ Setup dotnet
159-
uses: actions/setup-dotnet@v4
159+
uses: actions/setup-dotnet@v5
160160
with:
161161
dotnet-version: |
162162
9.0.x
163163
164-
- uses: actions/download-artifact@v4
164+
- uses: actions/download-artifact@v5
165165
with:
166166
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
167167
path: ${{ env.NUGET_DIRECTORY }}
@@ -211,20 +211,17 @@ jobs:
211211
runs-on: ubuntu-latest
212212
steps:
213213
- name: 🛒 Checkout repository
214-
uses: actions/checkout@v4
214+
uses: actions/checkout@v5
215215
with:
216216
fetch-depth: 0
217217

218218
- name: ⚙️ Setup dotnet versions
219-
uses: actions/setup-dotnet@v4
219+
uses: actions/setup-dotnet@v5
220220
with:
221221
dotnet-version: |
222-
3.1.x
223-
5.0.x
224-
6.0.x
225-
7.0.x
226222
8.0.x
227223
9.0.x
224+
10.0.x
228225
229226
- name: ⚙️ Setup GIT versioning
230227
uses: dotnet/[email protected]
@@ -267,25 +264,30 @@ jobs:
267264
if: github.event_name == 'pull_request' && github.repository_owner == 'bunit-dev'
268265
steps:
269266
- name: 'Checkout Repository'
270-
uses: actions/checkout@v4
267+
uses: actions/checkout@v5
271268
- name: 'Dependency Review'
272269
uses: actions/dependency-review-action@v4
273270

274271
release-preview:
275272
if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
276273
runs-on: ubuntu-latest
277274
needs: [ validate-nuget, run-test, validate-template, validate-docs ]
275+
permissions:
276+
id-token: write
278277
steps:
279-
- uses: actions/download-artifact@v4
278+
- uses: actions/download-artifact@v5
280279
with:
281280
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
282281
path: ${{ env.NUGET_DIRECTORY }}
283282

284283
- name: Setup .NET Core
285-
uses: actions/setup-dotnet@v4
284+
uses: actions/setup-dotnet@v5
286285

287-
- name: 🛠️ Upload library to GitHub Package Repository
288-
run: dotnet nuget push ${{ env.NUGET_DIRECTORY }}/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bunit-dev/index.json --skip-duplicate --no-symbols
286+
- name: 🛠️ NuGet login
287+
uses: NuGet/login@v1
288+
id: nuget-login
289+
with:
290+
user: ${{ secrets.NUGET_USER }}
289291

290292
- name: 🛠️ Upload library to NuGet.org repository
291-
run: dotnet nuget push ${{ env.NUGET_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
293+
run: dotnet nuget push ${{ env.NUGET_DIRECTORY }}/*.nupkg -k ${{ steps.nuget-login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols

.github/workflows/docs-deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131

3232
- name: 🛒 Checkout repository
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v5
3434
with:
3535
fetch-depth: 0
3636
token: ${{ secrets.BUNIT_BOT_TOKEN }}
@@ -70,11 +70,12 @@ jobs:
7070
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
7171

7272
- name: ⚙️ Setup dotnet versions
73-
uses: actions/setup-dotnet@v4
73+
uses: actions/setup-dotnet@v5
7474
with:
7575
dotnet-version: |
7676
8.0.x
7777
9.0.x
78+
10.0.x
7879
7980
- name: 🎨 Setup color
8081
run: |

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.ref == 'refs/heads/main' && contains(fromJson('["major","minor"]'), github.event.inputs.versionIncrement)
1717
steps:
1818
- name: 🛒 Checkout repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020
with:
2121
fetch-depth: 0
2222
token: ${{ secrets.BUNIT_BOT_TOKEN }}

.github/workflows/rebase-v2-on-main.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ jobs:
2626
if: github.ref == 'refs/heads/stable' ||
2727
github.event.pull_request.merged == true && contains(github.head_ref, 'release/v') == true
2828
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
2931
steps:
3032

3133
- name: 🛒 Checkout repository
32-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3335
with:
3436
fetch-depth: 0
3537
token: ${{ secrets.BUNIT_BOT_TOKEN }}
@@ -55,11 +57,12 @@ jobs:
5557
setAllVars: true
5658

5759
- name: ⚙️ Setup dotnet versions
58-
uses: actions/setup-dotnet@v4
60+
uses: actions/setup-dotnet@v5
5961
with:
6062
dotnet-version: |
6163
8.0.x
6264
9.0.x
65+
10.0.x
6366
6467
- name: 🛠️ Update changelog
6568
uses: thomaseizinger/[email protected]
@@ -96,13 +99,19 @@ jobs:
9699
- name: 🛠️ Packing library in release mode
97100
run: |
98101
dotnet pack src/bunit/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
99-
dotnet pack src/bunit.core/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
100-
dotnet pack src/bunit.web/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
102+
dotnet pack src/bunit.template/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
101103
dotnet pack src/bunit.web.query/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
104+
dotnet pack src/bunit.generators/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
105+
106+
- name: 🛠️ NuGet login
107+
uses: NuGet/login@v1
108+
id: nuget-login
109+
with:
110+
user: ${{ secrets.NUGET_USER }}
102111

103112
- name: 🛠️ Upload library to NuGet.org repository
104113
run: |
105-
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
114+
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ steps.nuget-login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
106115
107116
- name: ⏩ Push stable branch
108117
run: git push origin stable

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ All notable changes to **bUnit** will be documented in this file. The project ad
66

77
## [Unreleased]
88

9+
This major release focuses on platform updates and API simplifications.
10+
11+
For a migration guide, see [Upgrading bUnit](https://bunit.dev/docs/migrations/index.html).
12+
13+
### Changed
14+
15+
- Target framework support updated: added support for .NET 10 (`net10.0`) and dropped all versions prior to .NET 8 (`net8.0`).
16+
- Cleanup of the API with simplifications of many API calls and methods. This also includes renaming of some objects to better reflect their purpose.
17+
18+
### Added
19+
20+
- Support for form submission from submit buttons and inputs that are outside the form element but associated via the HTML5 `form` attribute. Reported and fixed in [#1766](https://github.com/bUnit-dev/bUnit/issues/1766).
21+
- Improved renderer logic that catches more edge cases.
22+
- Improved developer experience in relation to JSInterop.
23+
924
## [1.40.0] - 2025-06-14
1025

1126
### Fixed
@@ -85,6 +100,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad
85100

86101
- CI build changes to force running verification on x64 based AMD CPUs.
87102

103+
### Added
104+
105+
- New overloads for `ComponentParameterCollectionBuilder.Add` that allow passing arguments for asynchronous callback parameters. Reported by [springy76](https://github.com/springy76). By [@Qwertyluk](https://github.com/Qwertyluk).
106+
88107
## [1.28.9] - 2024-04-19
89108

90109
### Fixed
@@ -743,7 +762,7 @@ List of new features.
743762

744763
- Added `Render(RenderFragment)` and `Render<TComponent>(RenderFragment)` methods to `TestContext`, as well as various overloads to the `MarkupMatches` methods, that also takes a `RenderFragment` as the expected value.
745764

746-
The difference between the generic `Render` method and the non-generic one is that the generic returns an `IRenderedComponent<TComponent>`, whereas the non-generic one returns a `IRenderedFragment`.
765+
The difference between the generic `Render` method and the non-generic one is that the generic returns an `IRenderedComponent<TComponent>`, whereas the non-generic one returns a `RenderedFragment`.
747766

748767
Calling `Render<TComponent>(RenderFragent)` is equivalent to calling `Render(RenderFragment).FindComponent<TComponent>()`, e.g. it returns the first component in the render tree of type `TComponent`. This is different from the `RenderComponent<TComponent>()` method, where `TComponent` _is_ the root component of the render tree.
749768

0 commit comments

Comments
 (0)