MCPcopy
hub / github.com/plotly/plotly.js / assertSize

Function assertSize

test/jasmine/tests/toimage_test.js:42–53  ·  view source on GitHub ↗
(url, width, height)

Source from the content-addressed store, hash-verified

40 }
41
42 function assertSize(url, width, height) {
43 return new Promise(function (resolve, reject) {
44 var img = new Image();
45 img.onload = function () {
46 expect(img.width).toBe(width, 'image width');
47 expect(img.height).toBe(height, 'image height');
48 resolve(url);
49 };
50 img.onerror = reject;
51 img.src = url;
52 });
53 }
54
55 it('should be attached to Plotly', function () {
56 expect(Plotly.toImage).toBeDefined();

Callers 1

toimage_test.jsFile · 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…