forked from semantic-release/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathis-latest-release.test.js
More file actions
39 lines (34 loc) · 882 Bytes
/
is-latest-release.test.js
File metadata and controls
39 lines (34 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import test from "ava";
import isLatestRelease from "../lib/is-latest-release.js";
test("Test for empty object", (t) => {
const branch = {};
t.is(isLatestRelease(branch), "false");
});
test("Test if type release and main is used correctly", (t) => {
const branch = {
type: "release",
main: true,
};
t.is(isLatestRelease(branch), "true");
});
test("Test if type prerelease is used correctly", (t) => {
const branch = {
type: "prerelease",
main: true,
};
t.is(isLatestRelease(branch), "false");
});
test("Test if type main property as boolean is used correctly", (t) => {
const branch = {
type: "release",
main: false,
};
t.is(isLatestRelease(branch), "false");
});
test("Test maintenance branch returns false", (t) => {
const branch = {
type: "maintenance",
main: false,
};
t.is(isLatestRelease(branch), "false");
});