Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/BuiltInTools/dotnet-watch/Watch/DotNetWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public static async Task WatchAsync(DotNetWatchContext context, CancellationToke
{
[EnvironmentVariables.Names.DotnetWatch] = "1",
[EnvironmentVariables.Names.DotnetWatchIteration] = (iteration + 1).ToString(CultureInfo.InvariantCulture),
}
},
OnOutput = line => context.ProcessOutputReporter.ReportOutput(line)
};

var browserRefreshServer = projectRootNode != null && HotReloadAppModel.InferFromProject(context, projectRootNode) is WebApplicationAppModel webAppModel
Expand Down
14 changes: 14 additions & 0 deletions test/dotnet-watch.Tests/Watch/NoDepsAppTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,19 @@ public async Task RestartProcessThatTerminatesAfterFileChange()
Assert.NotEqual(processIdentifier, processIdentifier2);
await App.AssertExiting(); // process should exit after run
}

[Fact]
public async Task CapturesStdOutWithNoHotReload()
{
var testAsset = TestAssets.CopyTestAsset(AppName)
.WithSource();

App.Start(testAsset, ["--no-hot-reload"]);

// Verify stdout is captured - application prints "Started" and "Process identifier"
await App.AssertOutputLineStartsWith("Started");
await App.AssertOutputLineStartsWith("Process identifier =");
await App.AssertExiting();
}
}
}
Loading