YahooArchive / arrow

FE Test framework designed to promote TDD
http://yahoo.github.io/arrow/arrow_intro.html
BSD 3-Clause "New" or "Revised" License
55 stars 59 forks source link

Show the point of failure if assertion fails #256

Open pranavparikh opened 10 years ago

pranavparikh commented 10 years ago

If some assertion fails , Arrow should output the actual assertion which failed.

For e.g, in the test below,

var module = Y.one('#mediasportsathletefilter'), suite = new Y.Test.Suite("MediaSportsAthleteFilter Test Suite");

suite.add(new Y.Test.Case({
  "#1 - test Module Presence": function() {
    Y.Assert.isNotNull(module);
    Y.Assert.isTrue(module.one('.hd h3').get('text') !== '');
    Y.Assert.areEqual(module.all('.bd select').size(), 2);
    Y.Assert.areEqual(module.all('.bd input').size(), 4);
  }
}));

If Y.Assert.isTrue(module.one('.hd h3').get('text') !== ''); failed, output the line

Y.Assert.isTrue(module.one('.hd h3').get('text') !== ''); alongwith the failed assertion in the error message.