Merge pull request #674 from danvk/module
[dygraphs.git] / auto_tests / tests / scientific_notation.js
index d9dab6c..a502484 100644 (file)
@@ -5,14 +5,13 @@
  *
  * @author danvk@google.com (Dan Vanderkam)
  */
-describe("scientific-notation", function() {
 
-beforeEach(function() {
-  document.body.innerHTML = "<div id='graph'></div>";
-});
+import Dygraph from '../../src/dygraph';
+import {assertDeepCloseTo} from './custom_asserts';
 
-afterEach(function() {
-});
+describe("scientific-notation", function() {
+
+cleanupAfterEach();
 
 function getXValues(g) {
   var xs = [];
@@ -32,7 +31,7 @@ it('testScientificInput', function() {
 
   var graph = document.getElementById("graph");
   var g = new Dygraph(graph, data, {});
-  assert.equalsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
+  assertDeepCloseTo([10, 20, 30, 40], getXValues(g), 1e-6);
 });
 
 it('testScientificInputPlus', function() {
@@ -45,7 +44,7 @@ it('testScientificInputPlus', function() {
 
   var graph = document.getElementById("graph");
   var g = new Dygraph(graph, data, {});
-  assert.equalsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
+  assertDeepCloseTo([10, 20, 30, 40], getXValues(g), 1e-6);
 });
 
 it('testScientificInputMinus', function() {
@@ -58,7 +57,7 @@ it('testScientificInputMinus', function() {
 
   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);
+  assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
 });
 
 it('testScientificInputMinusCap', function() {
@@ -71,7 +70,7 @@ it('testScientificInputMinusCap', function() {
 
   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);
+  assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
 });
 
 });