Skip to content

Commit 0bca11a

Browse files
add unit testing
1 parent 18cd9fa commit 0bca11a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/tasks/gitTags.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ describe("getNextGitTag", () => {
1616
expect(result).to.equal("v0.1.2");
1717
});
1818

19+
it("should not throw an error if single variant is missing (not multi-variant)", () => {
20+
const ctx = {
21+
"geth.dnp.dapnode.eth": {
22+
variant: null,
23+
nextVersion: "0.1.2"
24+
}
25+
};
26+
expect(() => getNextGitTag(ctx, false)).to.not.throw()
27+
});
28+
29+
it("should throw an error if single variant is missing (multi-variant)", () => {
30+
const ctx = {
31+
"geth.dnp.dapnode.eth": {
32+
variant: null,
33+
nextVersion: "0.1.2"
34+
}
35+
};
36+
expect(() => getNextGitTag(ctx, true)).to.throw("Could not generate git tag. Missing variant");
37+
});
38+
1939
it("should format a single-variant package as variant@v<version> if isMultiVariant is true", () => {
2040
const ctx = {
2141
"gnosis.dnp.dapnode.eth": {

0 commit comments

Comments
 (0)