@@ -5,13 +5,16 @@ import { fooPlugin } from "./plugins/foo/index.js";
5
5
import { barPlugin } from "./plugins/bar/index.js" ;
6
6
import { voidPlugin } from "./plugins/void/index.js" ;
7
7
8
- const base = new Base ( ) ;
8
+ const base = new Base ( {
9
+ version : "1.2.3" ,
10
+ } ) ;
9
11
10
12
// @ts -expect-error unknown properties cannot be used, see #31
11
13
base . unknown ;
12
14
13
15
const FooBase = Base . plugin ( fooPlugin ) . defaults ( {
14
16
default : "value" ,
17
+ version : "1.2.3" ,
15
18
} ) ;
16
19
const fooBase = new FooBase ( {
17
20
option : "value" ,
@@ -22,13 +25,17 @@ expectType<string>(fooBase.options.option);
22
25
expectType < string > ( fooBase . foo ) ;
23
26
24
27
const BaseWithVoidPlugin = Base . plugin ( voidPlugin ) ;
25
- const baseWithVoidPlugin = new BaseWithVoidPlugin ( ) ;
28
+ const baseWithVoidPlugin = new BaseWithVoidPlugin ( {
29
+ version : "1.2.3" ,
30
+ } ) ;
26
31
27
32
// @ts -expect-error unknown properties cannot be used, see #31
28
33
baseWithVoidPlugin . unknown ;
29
34
30
35
const BaseWithFooAndBarPlugins = Base . plugin ( barPlugin , fooPlugin ) ;
31
- const baseWithFooAndBarPlugins = new BaseWithFooAndBarPlugins ( ) ;
36
+ const baseWithFooAndBarPlugins = new BaseWithFooAndBarPlugins ( {
37
+ version : "1.2.3" ,
38
+ } ) ;
32
39
33
40
expectType < string > ( baseWithFooAndBarPlugins . foo ) ;
34
41
expectType < string > ( baseWithFooAndBarPlugins . bar ) ;
@@ -41,7 +48,9 @@ const BaseWithVoidAndNonVoidPlugins = Base.plugin(
41
48
voidPlugin ,
42
49
fooPlugin
43
50
) ;
44
- const baseWithVoidAndNonVoidPlugins = new BaseWithVoidAndNonVoidPlugins ( ) ;
51
+ const baseWithVoidAndNonVoidPlugins = new BaseWithVoidAndNonVoidPlugins ( {
52
+ version : "1.2.3" ,
53
+ } ) ;
45
54
46
55
expectType < string > ( baseWithVoidAndNonVoidPlugins . foo ) ;
47
56
expectType < string > ( baseWithVoidAndNonVoidPlugins . bar ) ;
0 commit comments