File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
src/BuiltInTools/HotReloadClient/Web
test/dotnet-watch.Tests/Browser Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -299,14 +299,7 @@ public ValueTask RefreshBrowserAsync(CancellationToken cancellationToken)
299299 public ValueTask ReportCompilationErrorsInBrowserAsync ( ImmutableArray < string > compilationErrors , CancellationToken cancellationToken )
300300 {
301301 logger . Log ( LogEvents . UpdatingDiagnostics ) ;
302- if ( compilationErrors . IsEmpty )
303- {
304- return SendJsonMessageAsync ( new AspNetCoreHotReloadApplied ( ) , cancellationToken ) ;
305- }
306- else
307- {
308- return SendJsonMessageAsync ( new HotReloadDiagnostics { Diagnostics = compilationErrors } , cancellationToken ) ;
309- }
302+ return SendJsonMessageAsync ( new HotReloadDiagnostics { Diagnostics = compilationErrors } , cancellationToken ) ;
310303 }
311304
312305 public async ValueTask UpdateStaticAssetsAsync ( IEnumerable < string > relativeUrls , CancellationToken cancellationToken )
Original file line number Diff line number Diff line change @@ -79,8 +79,13 @@ await App.WaitUntilOutputContains("""
7979 🧪 Received: Reload
8080 """ ) ;
8181
82+ // no other browser message sent:
83+ Assert . Equal ( 2 , App . Process . Output . Count ( line => line . Contains ( "🧪" ) ) ) ;
84+
8285 await App . WaitForOutputLineContaining ( MessageDescriptor . WaitingForChanges ) ;
8386
87+ App . Process . ClearOutput ( ) ;
88+
8489 // another rude edit:
8590 UpdateSourceFile ( homePagePath , src => src . Replace ( "public virtual int F() => 1;" , "/* member placeholder */" ) ) ;
8691
@@ -98,13 +103,25 @@ await App.WaitUntilOutputContains("""
98103 🧪 Received: Reload
99104 """ ) ;
100105
106+ // no other browser message sent:
107+ Assert . Equal ( 2 , App . Process . Output . Count ( line => line . Contains ( "🧪" ) ) ) ;
108+
109+ App . Process . ClearOutput ( ) ;
110+
101111 // valid edit:
102112 UpdateSourceFile ( homePagePath , src => src . Replace ( "/* member placeholder */" , "public int F() => 1;" ) ) ;
103113
104114 await App . WaitForOutputLineContaining ( MessageDescriptor . HotReloadSucceeded ) ;
105115
116+ await App . WaitUntilOutputContains ( $$ """
117+ 🧪 Received: {"type":"HotReloadDiagnosticsv1","diagnostics":[]}
118+ """ ) ;
119+
106120 await App . WaitUntilOutputContains ( $$ """
107121 🧪 Received: {"type":"AspNetCoreHotReloadApplied"}
108122 """ ) ;
123+
124+ // no other browser message sent:
125+ Assert . Equal ( 2 , App . Process . Output . Count ( line => line . Contains ( "🧪" ) ) ) ;
109126 }
110127}
You can’t perform that action at this time.
0 commit comments