You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
568 B

2 years ago
var baseTemplate = window.document.body.innerHTML;
var wrapper = document.createElement('div');
wrapper.id = 'jasmineWrapper';
document.body.appendChild(wrapper);
beforeEach(function() {
jasmineWrapper.innerHTML = '';
jasmine.addMatchers({
toBeApprox: function() {
return {
compare: function(actual, expected, within) {
within = within || 1;
return { pass: (actual >= (expected - within)) && (actual <= (expected + within)) };
}
};
}
});
});