meteor-rtd-example-project
meteor-rtd-example-project copied to clipboard
In the cucumber feature "Actions.verifyTheirScoreIs" is no checking the score
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));
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.
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?
@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?
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...
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.
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...
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!