Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,10 @@ public async Task AutoRestartOnRudeEditAfterRestartPrompt()
// rude edit: adding virtual method
UpdateSourceFile(programPath, src => src.Replace("/* member placeholder */", "public virtual void F() {}"));

// the prompt is printed into stdout while the error is printed into stderr, so they might arrive in any order:
await App.AssertOutputLineStartsWith(" ❔ Do you want to restart your app? Yes (y) / No (n) / Always (a) / Never (v)", failure: _ => false);
await App.WaitUntilOutputContains(MessageDescriptor.RestartNeededToApplyChanges);

App.AssertOutputContains(MessageDescriptor.RestartNeededToApplyChanges);
App.AssertOutputContains($"❌ {programPath}(39,11): error ENC0023: Adding an abstract method or overriding an inherited method requires restarting the application.");
App.Process.ClearOutput();

Expand Down Expand Up @@ -1259,9 +1260,10 @@ public async Task Aspire_BuildError_ManualRestart()
serviceSourcePath,
serviceSource.Replace("record WeatherForecast", "record WeatherForecast2"));

// the prompt is printed into stdout while the error is printed into stderr, so they might arrive in any order:
await App.WaitForOutputLineContaining(" ❔ Do you want to restart these projects? Yes (y) / No (n) / Always (a) / Never (v)");
await App.WaitUntilOutputContains(MessageDescriptor.RestartNeededToApplyChanges);

App.AssertOutputContains(MessageDescriptor.RestartNeededToApplyChanges);
App.AssertOutputContains($"dotnet watch ❌ {serviceSourcePath}(40,1): error ENC0020: Renaming record 'WeatherForecast' requires restarting the application.");
App.AssertOutputContains("dotnet watch ⌚ Affected projects:");
App.AssertOutputContains("dotnet watch ⌚ WatchAspire.ApiService");
Expand Down