Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.

Added notContainSubset option to assert - #71

Open
diego3g wants to merge 2 commits into
debitoor:masterfrom
diego3g:assert-not
Open

Added notContainSubset option to assert#71
diego3g wants to merge 2 commits into
debitoor:masterfrom
diego3g:assert-not

Conversation

@diego3g

@diego3g diego3g commented Jul 18, 2018

Copy link
Copy Markdown

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 diego3g changed the title Added toNotContain option to assert Added notContainSubset option to assert Jul 18, 2018
@diego3g

diego3g commented Aug 17, 2018

Copy link
Copy Markdown
Author

Any updated on this?

@eagleeye

Copy link
Copy Markdown
Contributor

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

@diego3g

diego3g commented Aug 20, 2018

Copy link
Copy Markdown
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants