Merge pull request #565 from danvk/gulp
[dygraphs.git] / auto_tests / tests / custom_asserts.js
diff --git a/auto_tests/tests/custom_asserts.js b/auto_tests/tests/custom_asserts.js
new file mode 100644 (file)
index 0000000..06e2444
--- /dev/null
@@ -0,0 +1,11 @@
+/**
+ * @fileoverview Assertions that chai doesn't provide out of the box.
+ */
+
+var assertDeepCloseTo = function(actualArray, expectedArray, epsilon) {
+  assert.isArray(actualArray);
+  assert.isArray(expectedArray);
+  for (var i = 0; i < actualArray.length; i++) {
+    assert.closeTo(actualArray[i], expectedArray[i], epsilon);
+  }
+};