Skip to content

Commit

Permalink
Merge pull request 11ty#2476 from Snapstromegon/ut-eleventy
Browse files Browse the repository at this point in the history
Add tests to get UT Coverage for utils/DateGit* to 100
  • Loading branch information
zachleat authored Jun 30, 2022
2 parents ef591dd + 826ae10 commit 8674f34
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/EleventyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ test("#142: date 'git Last Modified' populates page.date", async (t) => {
t.is(result.content.trim(), "" + comparisonDate.getTime());
});

test("DateGitLastUpdated returns undefined on nonexistent path", (t) => {
t.is(DateGitLastUpdated("./test/invalid.invalid"), undefined);
});

test("#2167: Pagination with permalink: false", async (t) => {
let elev = new Eleventy("./test/stubs-2167/", "./test/stubs-2167/_site");
elev.setDryRun(true);
Expand Down Expand Up @@ -560,3 +564,7 @@ test("#2224: date 'git created' populates page.date", async (t) => {
let comparisonDate = DateGitFirstAdded("./test/stubs-2224/index.njk");
t.is(result.content.trim(), "" + comparisonDate.getTime());
});

test("DateGitFirstAdded returns undefined on nonexistent path", async (t) => {
t.is(DateGitFirstAdded("./test/invalid.invalid"), undefined);
});

0 comments on commit 8674f34

Please sign in to comment.