chaijs / chai-things

Chai support for assertions on array elements
http://chaijs.com/plugins/chai-things
Other
104 stars 14 forks source link

Support for Chai 3? #44

Open chrisfosterelli opened 8 years ago

chrisfosterelli commented 8 years ago

Does this library work with Chai 3? After upgrading I now receive an error:

expect(res.body.data.comments).to.not.include.any.with.property('isHidden', true);

Leads to:

Fatal error: [ { _id: '8fa3d24de60f1a738a9d9dce',
    isHidden: false,
    isModerated: false } ] has no property 'isHidden'
meeber commented 8 years ago

@chrisfosterelli I believe the problem is specifically with the any flag, which was added directly to Chai back in v2.0 via https://github.com/chaijs/chai/pull/313, causing chai-things to skip over it here. I believe any of the aliases will still work in place of any: something, thing, item, one, or some.

@keithamus Do you want to make this as "PR Wanted" for fixing the any flag here using overwriteProperty?

chrisfosterelli commented 8 years ago

@meeber Thanks, that workaround let's me upgrade to 3.5! I'll leave this issue open since it sounds like it is a bug.