X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fcustom_asserts.js;fp=auto_tests%2Ftests%2Fcustom_asserts.js;h=06e2444175430a1c8c88bbed4115b54c4e4430fb;hb=dc910fcebc0da0a621cf16073ebedabcff32fb12;hp=0000000000000000000000000000000000000000;hpb=89fdcedbda6906d90e15d84285c4f6c0b8d96d28;p=dygraphs.git diff --git a/auto_tests/tests/custom_asserts.js b/auto_tests/tests/custom_asserts.js new file mode 100644 index 0000000..06e2444 --- /dev/null +++ b/auto_tests/tests/custom_asserts.js @@ -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); + } +};