Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert support is missing #6

Closed
faassen opened this issue Mar 5, 2015 · 6 comments
Closed

assert support is missing #6

faassen opened this issue Mar 5, 2015 · 6 comments

Comments

@faassen
Copy link

faassen commented Mar 5, 2015

I tried to use this plugin but was confused why it didn't work for "assert.equal". It turns out you need to install a bridging function on the "assert" object, see this mailing list entry:

https://groups.google.com/forum/#!topic/chaijs/Dwnbsbe0C70

I tried the following:

assert.equal = function(act, exp, msg) {
    new chai.Assertion(act, msg).to.equal(exp);
};

and now it works. The same should be done with the other overrides.

@astorije
Copy link
Owner

astorije commented Mar 5, 2015

Hey, thanks for trying to use the plugin, and for reporting this!

As you noticed, I just started this, it's not even on the npm repository yet!
So far I focused on expect support only as it was my direct need. I'll fix this soon and report on this issue.

@faassen
Copy link
Author

faassen commented Mar 6, 2015

Yes, I noticed you just started it, but I ran into it googling for chai integration with Immutable.js and I figured I'd give you the feedback. Thanks for looking into this!

@astorije
Copy link
Owner

astorije commented Mar 6, 2015

And I thank you for your feedback :-)
I'll let you know as soon as I can guarantee more stability on this. Stay tuned!

@astorije
Copy link
Owner

Hey @faassen!

1bcfae6 adds support for assert.equal. Before that, assert.strictEqual and assert.deepEqual would have worked since they both use the overridden base assertions, but now it's consistent across TDD and BDD interfaces.
Could you try it on your side to confirm it works as you want? I am not publishing a new version into npm until you do so, so you have to install the package from GitHub instead of npm packages: npm uninstall && npm install astorije/chai-immutable.

I am leaving this issue open until I add support of assert.sizeOf. After that I think I can close this issue. Do you see another assertion we could benefit from in the TDD interface?

@astorije
Copy link
Owner

Actually, adding support for assert.sizeOf was really straightforward so I did it right after, so that when you confirm you're okay with this I can publish into npm.

I close the issue because it seems to me that everything is covered for now. I'll reopen if you tell me that it doesn't match your expectations or doesn't work or needs more assertions.

@astorije
Copy link
Owner

Well actually (bis), I just published this support in version 0.3.0. My questions are still valid, but that'd be great if you can open a new issue instead of re-opening this one.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants