Skip to content

Nest snapshots under razor parents and Content items - #1909

Merged
SimonCropp merged 1 commit into
mainfrom
fix-razor-file-nesting
Sep 1, 2026
Merged

Nest snapshots under razor parents and Content items#1909
SimonCropp merged 1 commit into
mainfrom
fix-razor-file-nesting

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

DependentUpon always pointed at .cs. A Blazor test class sits in .razor.cs, or in the .razor itself, so nothing nested. The parent extension is now probed for, guarded on the project holding razor files so other projects pay nothing for it.

The razor and web SDKs claim extensions like .json and .config as Content and remove them from None. Those items only exist once the SDK props have been evaluated, so Content nesting is applied from Verify.targets, and only where nothing has already set a parent.

The snapshot glob also gained the default item excludes, so copies under bin and obj are no longer pulled into the project.

VerifyTests/Verify.Bunit#108

DependentUpon always pointed at <name>.cs. A Blazor test class sits in
<name>.razor.cs, or in the <name>.razor itself, so nothing nested. The
parent extension is now probed for, guarded on the project holding razor
files so other projects pay nothing for it.

The razor and web SDKs claim extensions like .json and .config as Content
and remove them from None. Those items only exist once the SDK props have
been evaluated, so Content nesting is applied from Verify.targets, and only
where nothing has already set a parent.

The snapshot glob also gained the default item excludes, so copies under
bin and obj are no longer pulled into the project.

VerifyTests/Verify.Bunit#108
@SimonCropp SimonCropp added this to the 33.0.0 milestone Sep 1, 2026
@SimonCropp
SimonCropp merged commit c4ec026 into main Sep 1, 2026
6 of 7 checks passed
@SimonCropp
SimonCropp deleted the fix-razor-file-nesting branch September 1, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant