Skip to content

Commit

Permalink
One for test for #184
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Feb 2, 2024
1 parent 532db56 commit 7245356
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ test("Minimum width threshold (valid)", async t => {
t.is(stats.jpeg[1].width, 1280);
});

test("Minimum width threshold (one width larger that source)", async t => {
// original is 1280
let stats = await eleventyImage("./test/bio-2017.jpg", {
widths: [1800],
formats: ["jpeg"],
outputDir: "./test/img/",
dryRun: true,
});
t.is(stats.jpeg.length, 1);
t.is(stats.jpeg[0].outputPath, path.join("test/img/KkPMmHd3hP-1280.jpeg"));
t.is(stats.jpeg[0].width, 1280);
});

test("Minimum width threshold (one gets rejected)", async t => {
// original is 1280
Expand Down

0 comments on commit 7245356

Please sign in to comment.