Skip to content

Commit 4b47731

Browse files
committed
test: initial version
1 parent 9b6b6fc commit 4b47731

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Base } from ".";
2+
3+
const fooPlugin = (test: Base): { foo(): "foo" } => {
4+
console.log("plugin evalutes");
5+
6+
return {
7+
foo: () => "foo"
8+
};
9+
};
10+
const barPlugin = (test: Base): { bar(): "bar" } => {
11+
console.log("plugin evalutes");
12+
13+
return {
14+
bar: () => "bar"
15+
};
16+
};
17+
18+
describe("Base", () => {
19+
it(".plugin(fooPlugin)", () => {
20+
const FooTest = Base.plugin(fooPlugin);
21+
const fooTest = new FooTest();
22+
expect(fooTest.foo()).toEqual("foo");
23+
});
24+
it(".plugin([fooPlugin, barPlugin])", () => {
25+
const FooBarTest = Base.plugin([fooPlugin, barPlugin]);
26+
const fooBarTest = new FooBarTest();
27+
expect(fooBarTest.foo()).toEqual("foo");
28+
expect(fooBarTest.bar()).toEqual("bar");
29+
});
30+
});

0 commit comments

Comments
 (0)