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

In the cucumber feature "Actions.verifyTheirScoreIs" is no checking the score #27

Open
merunga opened this issue Nov 7, 2013 · 7 comments

Comments

@merunga
Copy link

merunga commented Nov 7, 2013

If you change the last step of the feature from
Then "Grace Hopper" has a score of 15
to
Then "Grace Hopper" has a score of 500000
The scenario will still pass.

To solve this I included chai.js in the test/lib, and replace this line with

var expect = require('../../lib/chai.js').expect;
expect(parseInt(value)).to.equal(parseInt(points));
@samhatoum
Copy link
Member

Thanks for the feedback, What's I forgot to do, is make the callback return with an error the way the cucumber boys do it. Of course you can still use an assertion library. I'll update the example.

@ryw
Copy link

ryw commented Dec 11, 2013

I just did what @merunga suggested, and got the example actually asserting correctness.

When I added test/lib/chai.js I got jslint issues, so I had to disable that.

chai.js adds 4k LOC — @samhatoum was there some other vision to make the expectation work besides including chai?

@xolvio
Copy link
Collaborator

xolvio commented Dec 11, 2013

@ryw we use Jasmine. You can use mocha or any assertion framework you like. I'm wondering though, can't you just exclude chai.js from jslint checking?

@ryw
Copy link

ryw commented Dec 11, 2013

It appears that jasmine is already in the project — the work to be done is to integrate jasmine into the feature actions file, right? I'd be happy to do a PR for this as part of my learning on RTD...

@xolvio
Copy link
Collaborator

xolvio commented Dec 11, 2013

yes. sort of :) jasmine-node runs the acceptance tests as you can see here. This npm module is installed globally and it's probably best to leave that one alone. You can either share the jasmine that karma includes here /test/rtd/node_modules/karma-jasmine, or just include the jasmine assertion library in your code.

@ryw
Copy link

ryw commented Dec 11, 2013

Thanks for help @xolvio — did you leave this cucumber feature as you did to give people flexibility to choose their own assertion library, or is the actions.js file just unfinished?

If unfinished, I'll help finish it — sounds like sharing jasmine from karma would be the best solution, vs creating another copy of the library...

@xolvio
Copy link
Collaborator

xolvio commented Dec 11, 2013

I had set up the feature quickly as a sample and for people to freely use the library they chose, but it would actually be good to include it so the example works. Would love the help. Thanks!

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

No branches or pull requests

3 participants