Skip to content

Commit 19df682

Browse files
committed
test: .plugin() chaining
1 parent da7c253 commit 19df682

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/plugin.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,23 @@ describe("Octokit.plugin()", () => {
6262
const MyOctokit = Octokit.plugin(myPlugin).plugin(myPlugin);
6363
expect(() => new MyOctokit()).not.toThrow();
6464
});
65+
66+
it("supports chaining", () => {
67+
const MyOctokit = Octokit.plugin(() => {
68+
return {
69+
foo: "bar"
70+
};
71+
})
72+
.plugin(() => {
73+
return { baz: "daz" };
74+
})
75+
.plugin(() => {
76+
return { qaz: "naz" };
77+
});
78+
79+
const myClient = new MyOctokit();
80+
expect(myClient.foo).toEqual("bar");
81+
expect(myClient.baz).toEqual("daz");
82+
expect(myClient.qaz).toEqual("naz");
83+
});
6584
});

0 commit comments

Comments
 (0)