Skip to content

Commit 59da772

Browse files
committed
test: plugin function with empty object return
1 parent ef6406e commit 59da772

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const barPlugin = (test: Base) => {
1414
bar: () => "bar"
1515
};
1616
};
17+
const pluginWithEmptyObjectReturn = (test: Base) => {
18+
return {}
19+
}
1720

1821
describe("Base", () => {
1922
it(".plugin(fooPlugin)", () => {
@@ -27,6 +30,12 @@ describe("Base", () => {
2730
expect(fooBarTest.foo()).toEqual("foo");
2831
expect(fooBarTest.bar()).toEqual("bar");
2932
});
33+
it(".plugin([fooPlugin, barPlugin, pluginWithVoidReturn])", () => {
34+
const FooBarTest = Base.plugin([fooPlugin, barPlugin, pluginWithEmptyObjectReturn]);
35+
const fooBarTest = new FooBarTest();
36+
expect(fooBarTest.foo()).toEqual("foo");
37+
expect(fooBarTest.bar()).toEqual("bar");
38+
});
3039
it(".plugin(fooPlugin).plugin(barPlugin)", () => {
3140
const FooBarTest = Base.plugin(fooPlugin).plugin(barPlugin);
3241
const fooBarTest = new FooBarTest();

0 commit comments

Comments
 (0)