@@ -10,6 +10,38 @@ let resolveId: (id: string) => any
10
10
let moduleGraph : ModuleGraph
11
11
12
12
describe ( 'plugin container' , ( ) => {
13
+ it ( 'has bound methods' , async ( ) => {
14
+ expect . assertions ( 14 )
15
+ const entryUrl = '/x.js'
16
+
17
+ const plugin : Plugin = {
18
+ name : 'p1' ,
19
+ load ( id ) {
20
+ // bound functions and bound arrow functions do not have prototype
21
+ expect ( this . parse . prototype ) . equals ( undefined )
22
+ expect ( this . resolve . prototype ) . equals ( undefined )
23
+ expect ( this . load . prototype ) . equals ( undefined )
24
+ expect ( this . getModuleInfo . prototype ) . equals ( undefined )
25
+ expect ( this . getModuleIds . prototype ) . equals ( undefined )
26
+ expect ( this . addWatchFile . prototype ) . equals ( undefined )
27
+ expect ( this . getWatchFiles . prototype ) . equals ( undefined )
28
+ expect ( this . emitFile . prototype ) . equals ( undefined )
29
+ expect ( this . setAssetSource . prototype ) . equals ( undefined )
30
+ expect ( this . getFileName . prototype ) . equals ( undefined )
31
+ expect ( this . warn . prototype ) . equals ( undefined )
32
+ expect ( this . error . prototype ) . equals ( undefined )
33
+ expect ( this . debug . prototype ) . equals ( undefined )
34
+ expect ( this . info . prototype ) . equals ( undefined )
35
+ } ,
36
+ }
37
+
38
+ const container = await getPluginContainer ( {
39
+ plugins : [ plugin ] ,
40
+ } )
41
+
42
+ await container . load ( entryUrl )
43
+ } )
44
+
13
45
describe ( 'getModuleInfo' , ( ) => {
14
46
beforeEach ( ( ) => {
15
47
moduleGraph = new ModuleGraph ( ( id ) => resolveId ( id ) )
0 commit comments