Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
343dev committed Oct 28, 2024
1 parent efc8b4b commit 14162b6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('CLI', () => {
const stdout = runCliWithParameters(`--avif ${workDirectory}${file}`);

expectFileRatio({
stdout, file, maxRatio: 90, minRatio: 85, outputExt: 'avif',
stdout, file, maxRatio: 85, minRatio: 80, outputExt: 'avif',
});
expectFileNotModified(file);
});
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('CLI', () => {
const stdoutRatio = grepTotalRatio(stdout);

expectStringContains(stdout, 'Converting 6 images (lossy)...');
expectRatio(stdoutRatio, 85, 95);
expectRatio(stdoutRatio, 80, 85);
expectFileNotModified(`${fileBasename}.png`);
expectFileExists(`${fileBasename}.avif`);
});
Expand All @@ -179,7 +179,7 @@ describe('CLI', () => {
const stdout = runCliWithParameters(`--avif --lossless ${workDirectory}${file}`);

expectFileRatio({
stdout, file, maxRatio: 40, minRatio: 35, outputExt: 'avif',
stdout, file, maxRatio: 30, minRatio: 25, outputExt: 'avif',
});
expectFileNotModified(file);
});
Expand All @@ -199,7 +199,7 @@ describe('CLI', () => {
const stdoutRatio = grepTotalRatio(stdout);

expectStringContains(stdout, 'Converting 6 images (lossless)...');
expectRatio(stdoutRatio, 27, 31);
expectRatio(stdoutRatio, 15, 20);
expectFileNotModified(`${fileBasename}.png`);
expectFileExists(`${fileBasename}.avif`);

Expand Down Expand Up @@ -236,7 +236,7 @@ describe('CLI', () => {
const stdout = runCliWithParameters(`--webp ${workDirectory}${file}`);

expectFileRatio({
stdout, file, maxRatio: 40, minRatio: 35, outputExt: 'webp',
stdout, file, maxRatio: 30, minRatio: 25, outputExt: 'webp',
});
expectFileNotModified(file);
});
Expand All @@ -247,7 +247,7 @@ describe('CLI', () => {
const stdoutRatio = grepTotalRatio(stdout);

expectStringContains(stdout, 'Converting 6 images (lossy)...');
expectRatio(stdoutRatio, 60, 65);
expectRatio(stdoutRatio, 55, 60);
expectFileNotModified(`${fileBasename}.png`);
expectFileExists(`${fileBasename}.webp`);
});
Expand All @@ -259,7 +259,7 @@ describe('CLI', () => {
const stdout = runCliWithParameters(`--webp --lossless ${workDirectory}${file}`);

expectFileRatio({
stdout, file, maxRatio: 80, minRatio: 75, outputExt: 'webp',
stdout, file, maxRatio: 85, minRatio: 80, outputExt: 'webp',
});
expectFileNotModified(file);
});
Expand All @@ -269,7 +269,7 @@ describe('CLI', () => {
const stdout = runCliWithParameters(`--webp --lossless ${workDirectory}${file}`);

expectFileRatio({
stdout, file, maxRatio: 45, minRatio: 40, outputExt: 'webp',
stdout, file, maxRatio: 50, minRatio: 45, outputExt: 'webp',
});
expectFileNotModified(file);
});
Expand Down Expand Up @@ -321,7 +321,7 @@ describe('CLI', () => {

expectStringContains(stdout, 'Converting 1 image (lossless)...');
expectStringContains(stdout, path.join(temporary, `${fileBasename}.png`));
expectRatio(stdoutRatio, 40, 45);
expectRatio(stdoutRatio, 35, 40);
expectFileNotModified(`${fileBasename}.png`);
expectFileExists(`${fileBasename}.avif`);
expectFileExists(`${fileBasename}.webp`);
Expand Down

0 comments on commit 14162b6

Please sign in to comment.