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
Need a way to access chai's "should" object #327
Comments
@brettle Can you post a larger chunk of code showing what you are trying to do? I use chai should with cucumber.js all the time. (Mornag sends his greetings.) |
You are probably using the 'should' property like this:
That works fine if 'actual' exists. However to test if it exists Chai provides the should object returned by chai.should() which can be used like in my previous example. |
I use it like this:
|
Sorry for not being clear. I'm using cucumber-js via meteor-cucumber and at least in that context, require('chai') fails unless you create and add a separate meteor package which uses Npm.depends() to bring in the chai module. I created this issue at Sam Hatoum's request based on a discussion on the meteor forums. Perhaps require('chai') works fine outside the meteor context? |
Yeah, I use it all the time. As far as I know chai isn't a direct dependency of cucumber.js - you have to require it yourself. You can pull in any assertion library you want for a standard node.js project. |
I don't really understand what you expect from Cucumber here. It is agnostic on assertion/testing libraries. If a One solution I see is xolvio:cucumber adding Please reopen if you think there's something we can do on Cucumber's side. |
Sorry for the confusion. It looks like I should have filed this issue with xolvio/cuke-monkey (now xolvio/chimp). It appears to be fixed there at this point. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
[Edited to reflect that the problem occurs in a meteor velocity testing context.]
When using cucumber-js within meteor velocity, chai.should() is automatically called but there is currently no way to access the object that it returns. That object is normally used like this:
One solution would be to make the object returned by chai.should() available as global.should.
The text was updated successfully, but these errors were encountered: