Skip to content

expectNoEvents() does not account for terminal events #348

@saket

Description

@saket

When using expectNoEvents(), the method does consider that the flow's terminal event might have already been consumed.

flowOf("foo").test {
  skipItems(1)
  awaitComplete()
  expectNoEvents()
}

The above code produces this error:

TurbineAssertionError: Expected no events but found Complete

Additionally, it is currently possible to call awaitComplete() multiple times without any restriction. Should this be allowed?

flowOf("foo").test {
  skipItems(1)
  repeat(5) {
    awaitComplete()
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions