X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fsmooth_plotter.js;h=41b0f5d856cef016ad6775e1caeed5951f31fa90;hb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;hp=2268bb35f549c452887e5eddaf427d3f67d5f735;hpb=319d0361d2e512ed8049dfedffd79254e491201c;p=dygraphs.git diff --git a/auto_tests/tests/smooth_plotter.js b/auto_tests/tests/smooth_plotter.js index 2268bb3..41b0f5d 100644 --- a/auto_tests/tests/smooth_plotter.js +++ b/auto_tests/tests/smooth_plotter.js @@ -3,43 +3,45 @@ * * @author danvdk@gmail.com (Dan Vanderkam) */ -var smoothPlotterTestCase = TestCase("smooth-plotter"); +describe("smooth-plotter", function() { var getControlPoints = smoothPlotter._getControlPoints; -smoothPlotterTestCase.prototype.setUp = function() { -}; +beforeEach(function() { +}); -smoothPlotterTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -smoothPlotterTestCase.prototype.testNoSmoothing = function() { +it('testNoSmoothing', function() { var lastPt = {x: 10, y: 0}, pt = {x: 11, y: 1}, nextPt = {x: 12, y: 0}, alpha = 0; - assertEquals([11, 1, 11, 1], getControlPoints(lastPt, pt, nextPt, alpha)); -}; + assert.deepEqual([11, 1, 11, 1], getControlPoints(lastPt, pt, nextPt, alpha)); +}); -smoothPlotterTestCase.prototype.testHalfSmoothing = function() { +it('testHalfSmoothing', function() { var lastPt = {x: 10, y: 0}, pt = {x: 11, y: 1}, nextPt = {x: 12, y: 0}, alpha = 0.5; - assertEquals([10.5, 1, 11.5, 1], getControlPoints(lastPt, pt, nextPt, alpha)); -} + assert.deepEqual([10.5, 1, 11.5, 1], getControlPoints(lastPt, pt, nextPt, alpha)); +}); -smoothPlotterTestCase.prototype.testExtrema = function() { +it('testExtrema', function() { var lastPt = {x: 10, y: 0}, pt = {x: 11, y: 1}, nextPt = {x: 12, y: 1}, alpha = 0.5; - assertEquals([10.5, 0.75, 11.5, 1.25], + assert.deepEqual([10.5, 0.75, 11.5, 1.25], getControlPoints(lastPt, pt, nextPt, alpha, true)); - assertEquals([10.5, 1, 11.5, 1], + assert.deepEqual([10.5, 1, 11.5, 1], getControlPoints(lastPt, pt, nextPt, alpha, false)); -} +}); + +});