X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Frolling_average.js;h=4b68da20057ab90397f9355ebf0c83cfcaaf2d81;hb=ce31caf22475e3e1fd6d9fea192d61ff4fcd7fac;hp=41a652112b38d5ede7228214c73c72be05444b5f;hpb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git diff --git a/auto_tests/tests/rolling_average.js b/auto_tests/tests/rolling_average.js index 41a6521..4b68da2 100644 --- a/auto_tests/tests/rolling_average.js +++ b/auto_tests/tests/rolling_average.js @@ -3,14 +3,14 @@ * * @author danvk@google.com (Dan Vanderkam) */ -describe("rolling-average", function() { -beforeEach(function() { - document.body.innerHTML = "
"; -}); +import Dygraph from '../../src/dygraph'; -afterEach(function() { -}); +import Util from './Util'; + +describe("rolling-average", function() { + +cleanupAfterEach(); it('testRollingAverage', function() { var opts = { @@ -85,7 +85,7 @@ it('testRollBoxDoesntDisapper', function() { it('testRollShortFractions', function() { var opts = { customBars: true, - labels: ['x', 'A'] + labels: ['x', 'A', 'B'] }; var data1 = [ [1, 10, [1, 20]] ]; var data2 = [ [1, 10, [1, 20]], @@ -98,7 +98,7 @@ it('testRollShortFractions', function() { var rolled1 = g.dataHandler_.rollingAverage(data1, 1, g); var rolled2 = g.dataHandler_.rollingAverage(data2, 1, g); - assert.equal(rolled1[0], rolled2[0]); + assert.deepEqual(rolled1[0], rolled2[0]); }); it('testRollCustomBars', function() { @@ -143,9 +143,9 @@ it('testRollErrorBars', function() { var variance = Math.sqrt(2); for (var i=1;i