Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
Flush console at close to get full output
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm committed May 14, 2021
1 parent dfb098f commit eb64145
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func (m *Manager) CloseConsole(sc *godog.Scenario) {
return
}

m.flushSession(sess)

for _, fn := range m.closers {
fn(sc)
}
Expand All @@ -116,9 +118,13 @@ func (m *Manager) CloseConsole(sc *godog.Scenario) {
m.current = ""
}

func (m *Manager) flushSession(s *session) {
s.console.Expect(expect.EOF, expect.PTSClosed, expect.WithTimeout(10*time.Millisecond)) // nolint: errcheck, gosec
}

// Flush flushes console state.
func (m *Manager) Flush() {
m.session().console.Expect(expect.EOF, expect.PTSClosed, expect.WithTimeout(10*time.Millisecond)) // nolint: errcheck, gosec
m.flushSession(m.session())
}

func (m *Manager) isConsoleOutput(expected *godog.DocString) error {
Expand Down

0 comments on commit eb64145

Please sign in to comment.