From eceb13368676034d357de2fa3c2d2b170736328f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 13 Apr 2016 14:37:13 -0700 Subject: [PATCH] Tests: Second attempt to find fitting tolerance for failing gradient SVG export. --- test/helpers.js | 2 +- test/tests/SvgExport.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/helpers.js b/test/helpers.js index f38c165e..fb58c2f4 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -204,7 +204,7 @@ var comparePixels = function(actual, expected, message, options) { .onComplete(function(data) { result = data; }); // Compare with tolerance in percentage... var tolerance = (options.tolerance || 1e-4) * 100, - fixed = ((1 / tolerance) + '').length - 1, + fixed = tolerance < 1 ? ((1 / tolerance) + '').length - 1 : 0, identical = result ? 100 - result.misMatchPercentage : 0, reached = identical.toFixed(fixed), hundred = (100).toFixed(fixed), diff --git a/test/tests/SvgExport.js b/test/tests/SvgExport.js index 823db4dc..773438f7 100644 --- a/test/tests/SvgExport.js +++ b/test/tests/SvgExport.js @@ -188,7 +188,7 @@ if (!isNode) { var svg = project.exportSVG({ bounds: 'content', asString: true }); compareSVG(assert.async(), svg, project.activeLayer, null, { - tolerance: 1e-1 + tolerance: 1e-2 }); }); }