Skip to content

Commit 874a9ed

Browse files
committed
Fix test
1 parent 013e97d commit 874a9ed

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

test/dotnet-watch.Tests/CommandLine/LaunchSettingsTests.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,15 @@ public async Task RunsWithIterationEnvVariable()
9292

9393
App.Start(testAsset, []);
9494

95-
await App.AssertStarted();
95+
await App.WaitForOutputLineContaining(MessageDescriptor.WaitingForFileChangeBeforeRestarting);
9696

97-
var source = Path.Combine(testAsset.Path, "Program.cs");
98-
var contents = File.ReadAllText(source);
99-
const string messagePrefix = "DOTNET_WATCH_ITERATION = ";
97+
App.AssertOutputContains("DOTNET_WATCH_ITERATION = 1");
98+
App.Process.ClearOutput();
10099

101-
var value = await App.AssertOutputLineStartsWith(messagePrefix);
102-
Assert.Equal(1, int.Parse(value, CultureInfo.InvariantCulture));
100+
UpdateSourceFile(Path.Combine(testAsset.Path, "Program.cs"));
103101

104102
await App.WaitForOutputLineContaining(MessageDescriptor.WaitingForFileChangeBeforeRestarting);
105-
106-
UpdateSourceFile(source);
107-
await App.AssertStarted();
108-
109-
value = await App.AssertOutputLineStartsWith(messagePrefix);
110-
Assert.Equal(2, int.Parse(value, CultureInfo.InvariantCulture));
103+
App.AssertOutputContains("DOTNET_WATCH_ITERATION = 2");
111104
}
112105

113106
[Fact]

0 commit comments

Comments
 (0)