async function collectAndAssertError (stream, expectedError) {
    const result = await stream.pipe(materialize(), toArray()).toPromise()

    expect(result).toEqual([Notification.createError(expectedError)])
  }
@param {Observable} stream
@param {function(err: Error): void} expectationFunc