Skip to content

Commit

Permalink
✅ wait for exit on _all_ io tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffynuts committed Jan 10, 2024
1 parent bc10416 commit 40ee4d1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void ShouldBeAbleToReadFromStdOut()
.To.Be.Null();
var lines = io.StandardOutput.ToArray().Select(l => l.Trim());
// Assert
io.WaitForExit();
Expect(lines).To.Equal(
new[]
{
Expand All @@ -42,6 +43,7 @@ public void ShouldBeAbleToReadFromStdErr()
);
Expect(io.StartException)
.To.Be.Null();
io.WaitForExit();
var lines = io.StandardError.ToArray().Select(l => l.Trim());
// Assert
Expect(lines).To.Equal(
Expand All @@ -63,6 +65,7 @@ public void ShouldBeAbleToRunInDifferentDirectory()
// Act
using var io = ProcessIO.In(tempFolder.Path).Start("cat", "data.txt");
// Assert
io.WaitForExit();
var lines = io.StandardOutput.ToArray().Select(l => l.Trim());

Expect(lines)
Expand Down Expand Up @@ -179,6 +182,7 @@ public void ShouldNotBreakGivenNullEnvironment()
$"console.log(process.cwd()); console.log(process.env['{envVar}']);"
);
// Assert
io.WaitForExit();
var lines = io.StandardOutput.ToArray().Trim();
Expect(lines)
.To.Equal(
Expand Down Expand Up @@ -224,6 +228,7 @@ exit 0
}

io.StandardInput.WriteLine("quit");
io.WaitForExit();
var collected = io.StandardOutput.ToArray();
// Assert
Expect(collected)
Expand Down

0 comments on commit 40ee4d1

Please sign in to comment.