From c90f84cbf15b755bd40c355313d7dc29835da94d Mon Sep 17 00:00:00 2001 From: DanielJDufour Date: Mon, 24 Jul 2023 19:50:12 -0400 Subject: [PATCH] don't test for most common pixels when using methods that can lead to extremes like first, min or max --- test.js | 2 +- test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test.js b/test.js index aa8704e..3da6a67 100644 --- a/test.js +++ b/test.js @@ -262,7 +262,7 @@ const runTileTests = async ({ counts = count(result.data, { depth: 2 }); const sortedCounts = Object.entries(counts).sort((a, b) => Math.sign(b[1] - a[1])); const top = sortedCounts[0][0]; - if (method !== "first" && !out_bands) { + if (!["first", "min", "max"].includes(method) && !out_bands) { try { eq(most_common_pixels.includes(top), true); } catch (error) { diff --git a/test.ts b/test.ts index 957ebdf..b8eacec 100644 --- a/test.ts +++ b/test.ts @@ -272,7 +272,7 @@ const runTileTests = async ({ counts = count(result.data, { depth: 2 }); const sortedCounts = Object.entries(counts).sort((a, b) => Math.sign(b[1] - a[1])); const top = sortedCounts[0][0]; - if (method !== "first" && !out_bands) { + if (!["first", "min", "max"].includes(method) && !out_bands) { try { eq(most_common_pixels.includes(top), true); } catch (error) {