title: Test if an array is empty or contains a certain object with
body: <p>I want to test if an array is empty or contains objects of a certain structure. In pseudo code it could be something like this:</p>
  
  <pre><code>expect([])
    .toHaveLength(0)
    .or
    .arrayContaining(
      expect.toMatchObject(
       { foo: expect.any(String) }
      )
    ) =&gt; true
  
  expect([{foo: 'bar'}])
    .toHaveLength(0)
    .or
    .arrayContaining(
      expect.toMatchObject(
       { foo: expect.any(String) }
      )
    ) =&gt; true
  
  expect([1])
    .toHaveLength(0)
    .or
    .arrayContaining(
      expect.toMatchObject(
        { foo: expect.any(String) }
      )
    ) =&gt; false
  </code></pre>
  
  <p>Maybe I'm getting it wrong on the how things work in Jest, but to me my problem looks like an or-question.</p>