Jasmine Custom Matchers Do Not Work -
i made couple matchers, 1 designed pass, , other designed fail.
here spec file:
/* my-spec.js */ beforeeach(function() { var matchers = { topass: function() { homecoming { compare: function(actual) { homecoming { pass: true }; } }; }, tofail: function() { homecoming { compare: function(actual) { homecoming { pass: false }; } }; } }; this.addmatchers(matchers); }); describe("a suite", function() { it("contains spec expectation", function() { expect('this test').topass(); expect('this test').tofail(); }); }); when run jasmine-node tests (my file in tests folder), see:
. finished in 0.018 seconds 1 test, 2 assertions, 0 failures, 0 skipped what doing wrong?
i using old version of jasmine, next new documentation.
jasmine jasmine-node
No comments:
Post a Comment