projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump to version 2 🎉
[dygraphs.git]
/
auto_tests
/
tests
/
smooth_plotter.js
diff --git
a/auto_tests/tests/smooth_plotter.js
b/auto_tests/tests/smooth_plotter.js
index
2268bb3
..
146e426
100644
(file)
--- a/
auto_tests/tests/smooth_plotter.js
+++ b/
auto_tests/tests/smooth_plotter.js
@@
-3,43
+3,50
@@
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var smoothPlotterTestCase = TestCase("smooth-plotter");
+import Dygraph from '../../src/dygraph';
+import '../../src/extras/smooth-plotter'; // defines Dygraph.smoothPlotter
+
+describe("smooth-plotter", function() {
+
+var smoothPlotter = Dygraph.smoothPlotter;
var getControlPoints = smoothPlotter._getControlPoints;
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;
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 0},
alpha = 0;
- assert
Equals
([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;
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 0},
alpha = 0.5;
- assert
Equals
([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;
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 1},
alpha = 0.5;
- assert
Equals
([10.5, 0.75, 11.5, 1.25],
+ assert
.deepEqual
([10.5, 0.75, 11.5, 1.25],
getControlPoints(lastPt, pt, nextPt, alpha, true));
getControlPoints(lastPt, pt, nextPt, alpha, true));
- assert
Equals
([10.5, 1, 11.5, 1],
+ assert
.deepEqual
([10.5, 1, 11.5, 1],
getControlPoints(lastPt, pt, nextPt, alpha, false));
getControlPoints(lastPt, pt, nextPt, alpha, false));
-}
+});
+
+});