X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Ffast_canvas_proxy.js;h=a06fe4022a47701156c332a775cb186ed9d56e73;hb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;hp=1e4bfaf34bb7dc1298da3e9417e17d3cfa610da8;hpb=319d0361d2e512ed8049dfedffd79254e491201c;p=dygraphs.git diff --git a/auto_tests/tests/fast_canvas_proxy.js b/auto_tests/tests/fast_canvas_proxy.js index 1e4bfaf..a06fe40 100644 --- a/auto_tests/tests/fast_canvas_proxy.js +++ b/auto_tests/tests/fast_canvas_proxy.js @@ -3,13 +3,13 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var fastCanvasProxyTestCase = TestCase("fast-canvas-proxy"); +describe("fast-canvas-proxy", function() { -fastCanvasProxyTestCase.prototype.setUp = function() { -}; +beforeEach(function() { +}); -fastCanvasProxyTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); var fakeCanvasContext = { moveTo: function() {}, @@ -32,7 +32,7 @@ function extractMoveToAndLineToCalls(proxy) { return out; } -fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() { +it('testExtraMoveTosElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -43,12 +43,12 @@ fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() { fastProxy.moveTo(3, 1); fastProxy.stroke(); - assertEquals([['moveTo', 1, 1], + assert.deepEqual([['moveTo', 1, 1], ['lineTo', 2, 1], ['lineTo', 3, 1]], extractMoveToAndLineToCalls(htx)); -}; +}); -fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() { +it('testConsecutiveMoveTosElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -59,12 +59,12 @@ fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() { fastProxy.moveTo(3.2, 3); fastProxy.stroke(); - assertEquals([['moveTo', 1, 1], + assert.deepEqual([['moveTo', 1, 1], ['lineTo', 2, 1], ['moveTo', 3.2, 3]], extractMoveToAndLineToCalls(htx)); -}; +}); -fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() { +it('testSuperfluousSegmentsElided', function() { var htx = new Proxy(fakeCanvasContext); var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx); @@ -90,10 +90,12 @@ fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() { fastProxy.moveTo(3, 0); // dodge the "don't touch the last pixel" rule. fastProxy.stroke(); - assertEquals([['moveTo', 0.6, 1], + assert.deepEqual([['moveTo', 0.6, 1], ['lineTo', 1.0, 5], ['lineTo', 1.2, 0], ['lineTo', 1.7, 30], ['lineTo', 1.8, -30], ['moveTo', 3, 0]], extractMoveToAndLineToCalls(htx)); -}; +}); + +});