Skip to content

Commit 21aaa01

Browse files
committed
add test
1 parent bc33145 commit 21aaa01

3 files changed

Lines changed: 838 additions & 0 deletions

File tree

test/Gren.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,20 @@ describe("Gren", () => {
619619
});
620620
});
621621

622+
describe("_sortCommitsByParent", function () {
623+
it("Should sort the commits by parent", function () {
624+
const unsortedCommits = JSON.parse(
625+
fs.readFileSync(process.cwd() + "/test/data/commits_unsorted.json"),
626+
);
627+
const sortedCommits = JSON.parse(
628+
fs.readFileSync(process.cwd() + "/test/data/commits_sorted.json"),
629+
);
630+
const processedCommits = gren._sortCommitsByParent(unsortedCommits);
631+
632+
assert.deepEqual(processedCommits, sortedCommits, "The commits are sorted");
633+
});
634+
});
635+
622636
describe("_checkChangelogFile", () => {
623637
before(() => {
624638
gren.options.changelogFilename = "test/.temp/CHANGELOG.md";

0 commit comments

Comments
 (0)