File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments