From 295c72064571ae45794bbc47ec3bc8da5db724be Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 23 Sep 2019 15:34:24 +0200 Subject: [PATCH 1/2] Update to work with globby@10 With the globby v10 release, the shape of the file info object changed when requesting stats. See https://github.com/mrmlnc/fast-glob#stats for details. --- rendering/test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rendering/test.js b/rendering/test.js index 54eea0765a..24983b3382 100755 --- a/rendering/test.js +++ b/rendering/test.js @@ -251,11 +251,11 @@ async function render(entries, options) { } async function getLatest(patterns) { - const stats = await globby(patterns, {stats: true}); + const infoList = await globby(patterns, {stats: true}); let latest = 0; - for (const stat of stats) { - if (stat.mtime > latest) { - latest = stat.mtime; + for (const info of infoList) { + if (info.stats.mtime > latest) { + latest = info.stats.mtime; } } return latest; From 773ae437e4a7806aaff44f1ef1d197fc4e77ee55 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 23 Sep 2019 16:48:22 +0200 Subject: [PATCH 2/2] Small tolerance by default --- rendering/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rendering/test.js b/rendering/test.js index 24983b3382..2a4d7003a8 100755 --- a/rendering/test.js +++ b/rendering/test.js @@ -184,7 +184,7 @@ async function copyActualToExpected(entry) { async function renderEach(page, entries, options) { let fail = false; for (const entry of entries) { - const {tolerance = 0, message = ''} = await renderPage(page, entry, options); + const {tolerance = 0.001, message = ''} = await renderPage(page, entry, options); if (options.fix) { await copyActualToExpected(entry); @@ -204,7 +204,7 @@ async function renderEach(page, entries, options) { } if (mismatch > tolerance) { - options.log.error(`${detail}': mismatch ${mismatch.toFixed(3)}`); + options.log.error(`${detail}': mismatch ${mismatch}`); fail = true; } else { options.log.info(`${detail}': ok`);