MCPcopy Index your code
hub / github.com/plotly/plotly.js / assertSize

Function assertSize

test/jasmine/tests/pie_test.js:856–874  ·  view source on GitHub ↗
(msg, actual, exp)

Source from the content-addressed store, hash-verified

854
855 var previousSize;
856 function assertSize(msg, actual, exp) {
857 for(var k in exp) {
858 var parts = exp[k].split('|');
859 var op = parts[0];
860
861 var method = {
862 '=': 'toBe',
863 '~=': 'toBeWithin',
864 grew: 'toBeGreaterThan',
865 shrunk: 'toBeLessThan'
866 }[op];
867
868 var val = previousSize[k];
869 var msgk = msg + ' ' + k + (parts[1] ? ' |' + parts[1] : '');
870 var args = op === '~=' ? [val, 1.1, msgk] : [val, msgk, ''];
871
872 expect(actual[k])[method](args[0], args[1], args[2]);
873 }
874 }
875
876 function check(msg, restyleObj, exp) {
877 return function() {

Callers 1

checkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…