This repository has been archived on 2019-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
2017-12-05 00:13:47 +01:00

32 lines
809 B
JavaScript

import simulateScroll from './utils/simulateScroll';
const wrapper = document.createElement('div');
wrapper.id = 'jasmineWrapper';
document.body.appendChild(wrapper);
beforeEach(function() {
jasmine.addMatchers({
toBeApprox: function() {
return {
compare: function(actual, expected, within) {
within = within || 1.5;
return {
pass: actual >= expected - within && actual <= expected + within,
};
},
};
},
});
const reporterCurrentSpec = {
specStarted: function(result) {
window.testName = result.fullName;
},
};
jasmine.getEnv().addReporter(reporterCurrentSpec);
const jasmineWrapper = document.getElementById('jasmineWrapper');
jasmineWrapper.innerHTML = '';
simulateScroll(document.body, 0);
});