projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #565 from danvk/gulp
[dygraphs.git]
/
auto_tests
/
tests
/
scientific_notation.js
diff --git
a/auto_tests/tests/scientific_notation.js
b/auto_tests/tests/scientific_notation.js
index
bbdeb6a
..
ebbf2ed
100644
(file)
--- a/
auto_tests/tests/scientific_notation.js
+++ b/
auto_tests/tests/scientific_notation.js
@@
-5,14
+5,14
@@
*
* @author danvk@google.com (Dan Vanderkam)
*/
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var scientificNotationTestCase = TestCase("scientific-notation");
+describe("scientific-notation", function() {
-
scientificNotationTestCase.prototype.setUp =
function() {
+
beforeEach(
function() {
document.body.innerHTML = "<div id='graph'></div>";
document.body.innerHTML = "<div id='graph'></div>";
-};
+}
)
;
-
scientificNotationTestCase.prototype.tearDown =
function() {
-};
+
afterEach(
function() {
+}
)
;
function getXValues(g) {
var xs = [];
function getXValues(g) {
var xs = [];
@@
-22,7
+22,7
@@
function getXValues(g) {
return xs;
}
return xs;
}
-
scientificNotationTestCase.prototype.testScientificInput =
function() {
+
it('testScientificInput',
function() {
var data = "X,Y\n" +
"1.0e1,-1\n" +
"2.0e1,0\n" +
var data = "X,Y\n" +
"1.0e1,-1\n" +
"2.0e1,0\n" +
@@
-32,10
+32,10
@@
scientificNotationTestCase.prototype.testScientificInput = function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assert
EqualsDelta
([10, 20, 30, 40], getXValues(g), 1e-6);
-};
+ assert
DeepCloseTo
([10, 20, 30, 40], getXValues(g), 1e-6);
+}
)
;
-
scientificNotationTestCase.prototype.testScientificInputPlus =
function() {
+
it('testScientificInputPlus',
function() {
var data = "X,Y\n" +
"1.0e+1,-1\n" +
"2.0e+1,0\n" +
var data = "X,Y\n" +
"1.0e+1,-1\n" +
"2.0e+1,0\n" +
@@
-45,10
+45,10
@@
scientificNotationTestCase.prototype.testScientificInputPlus = function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assert
EqualsDelta
([10, 20, 30, 40], getXValues(g), 1e-6);
-};
+ assert
DeepCloseTo
([10, 20, 30, 40], getXValues(g), 1e-6);
+}
)
;
-
scientificNotationTestCase.prototype.testScientificInputMinus =
function() {
+
it('testScientificInputMinus',
function() {
var data = "X,Y\n" +
"1.0e-1,-1\n" +
"2.0e-1,0\n" +
var data = "X,Y\n" +
"1.0e-1,-1\n" +
"2.0e-1,0\n" +
@@
-58,10
+58,10
@@
scientificNotationTestCase.prototype.testScientificInputMinus = function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assert
EqualsDelta
([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
-};
+ assert
DeepCloseTo
([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
+}
)
;
-
scientificNotationTestCase.prototype.testScientificInputMinusCap =
function() {
+
it('testScientificInputMinusCap',
function() {
var data = "X,Y\n" +
"1.0E-1,-1\n" +
"2.0E-1,0\n" +
var data = "X,Y\n" +
"1.0E-1,-1\n" +
"2.0E-1,0\n" +
@@
-71,5
+71,7
@@
scientificNotationTestCase.prototype.testScientificInputMinusCap = function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assertEqualsDelta([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
-};
+ assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
+});
+
+});