debitoor / chai-subset

"containSubset" object properties matcher for Chai
http://chaijs.com/plugins/chai-subset/
MIT License
82 stars 20 forks source link

Added notContainSubset option to assert #71

Open diego3g opened 5 years ago

diego3g commented 5 years ago

Chai assert style generally includes an not version for every type of assertion (http://www.chaijs.com/api/assert/#method_notequal).

This PR includes the notContainSubset option to assert style.

Also runned prettier inside tests to respect ESLint rules.

diego3g commented 5 years ago

Any updated on this?

eagleeye commented 5 years ago

@diego3g you can just use chain method not e.g. to.not.containSubset()

diego3g commented 5 years ago

AdonisJS uses chai-subset without to and not so it can integrates with other assertion types from Adonis.

I can only use it like this:

assert.containSubset(obj, { find: true });

And can't use like this:

expect(obj).to.containSubset({ find: true })

So when i use:

assert.not.containSubset(...)

It returns:

TypeError: Cannot read property 'containSubset' of undefined

Do you think it's better to change something in Adonis? Actually i don't think it will bring downsides to chai-subset at all.