Custom messages for Jasmine expectations

Oct 25, 2014 03:19 · 55 words · 1 minute read

jasmine-custom-message gives you a “custom failure message on any jasmine assertion”:

describe('the story', function() {
  it('should finish ok', function() {
    since('all cats are grey in the dark').
    expect('tiger').toEqual('kitty'); // => 'all cats are grey in the dark'
  });
});

Overall, I like Jasmine as a testing library, but this particular limitation has really bothered me.