Skip to content

Commit 6a11a30

Browse files
committed
test(payloadHelper): fix tests
1 parent 78adf2c commit 6a11a30

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/PayloadHelper.test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,25 @@ describe("PayloadHelper", () => {
6464
expect(helper.getTemplateVariables()).toStrictEqual(expectedData);
6565
});
6666
it("should be able to return pull request variables", () => {
67+
// @ts-ignore
6768
const context: Context<Webhooks.WebhookPayloadPullRequest> = {
6869
payload: {
6970
// @ts-ignore
7071
pull_request: {
7172
body: "pr_body",
73+
head: {
74+
ref: "test-branch",
75+
label: "",
76+
sha: "",
77+
// @ts-ignore
78+
repo: {
79+
id: 1,
80+
node_id: "1",
81+
name: "",
82+
full_name: "",
83+
private: false
84+
}
85+
},
7286
number: 5,
7387
labels: [],
7488
patch_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1.patch",
@@ -97,7 +111,8 @@ describe("PayloadHelper", () => {
97111
patch_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1.patch",
98112
issue_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1",
99113
html_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1",
100-
diff_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1.diff"
114+
diff_url: "https://github.com/fossapps/Handlebars-Issue-and-Pull-Requests/pull/1.diff",
115+
branch: "test-branch"
101116
},
102117
id: 5
103118
};

0 commit comments

Comments
 (0)