Skip to content

Commit

Permalink
Add missing test for filename formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
saneef committed May 17, 2022
1 parent 79fb1e9 commit 565e6c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/img2picture.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,4 @@ function img2picture(userOptions) {
}

module.exports = img2picture;
module.exports.filenameFormatter = filenameFormatter;
8 changes: 8 additions & 0 deletions tests/filename.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const test = require("ava");

const { filenameFormatter } = require("../lib/img2picture.js");

test("Should generate filename", async (t) => {
const output = filenameFormatter("abcd", "hello.png", 600, "jpeg");
t.is("hello-abcd-600w.jpeg", output);
});

0 comments on commit 565e6c9

Please sign in to comment.