Skip to content

Commit

Permalink
allowing pixel values to be off by 1% due to rendering differences on…
Browse files Browse the repository at this point in the history
… operating systems
  • Loading branch information
catdad committed Dec 3, 2023
1 parent b5b796b commit f841fa9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ test('shoots default scaled confetti', async t => {

const pixels = await totalPixels(t.context.image);

t.is(pixels, 124);
const expected = 124;
t.true(pixels > expected * .99 && pixels < expected * 1.01, `${pixels}±1% ≠ ${expected}`);
});

test('shoots larger scaled confetti', async t => {
Expand All @@ -405,7 +406,8 @@ test('shoots larger scaled confetti', async t => {

const pixels = await totalPixels(t.context.image);

t.is(pixels, 11476);
const expected = 11476;
t.true(pixels > expected * .99 && pixels < expected * 1.01, `${pixels} ± 1% ≠ ${expected}`);
});

test('shoots confetti to the left', async t => {
Expand Down

0 comments on commit f841fa9

Please sign in to comment.