chaijs/chai-things

Include something that includes...

gabrielf opened this issue · 3 comments

Maybe this construct isn't even supposed to work but since it's not mentioned in the README I was surprised:

describe "the array ['abc', 'def']", ->
  array = ['abc', 'def']

  it "should include something that contain 'b'", ->
    array.should.include.something.that.contain('b')

Fails with:

  1) the array ['abc', 'def'] should include something that contain 'b':
     expected 'def' to include 'b'

I'm afraid this is a similar case like #7. Not sure if it is fixable with the current chai design…

What a shame, because it is such a nice plugin...

Maybe the README should end with a section:

Known issues

Because of how Chai works internally it is not possible to combine Chai Things in certain ways, see #4, #9.

Yes, I'm afraid that's the best solution. Added in 352aaf6.