lilishop-uniapp/node_modules/popper.js/tests/_setup.js

20 lines
568 B
JavaScript
Raw Normal View History

2021-05-13 11:03:32 +08:00
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)) };
}
};
}
});
});