Files
fullcalendar/tests/lib/jasmine-ext.js
T
2014-03-15 11:39:16 -07:00

27 lines
527 B
JavaScript

beforeEach(function() {
jasmine.addMatchers({
toEqualMoment: function() {
return {
compare: function(actual, expected) {
return {
pass: $.fullCalendar.moment(actual).format() ===
$.fullCalendar.moment(expected).format()
};
}
};
},
toEqualNow: function() {
return {
compare: function(actual) {
return {
pass: Math.abs(
$.fullCalendar.moment(actual) -
new Date()
) < 1000 // within a second of current datetime
};
}
};
}
});
});