@@ -66,12 +66,6 @@ test("ServiceWorkerGlobalScope: includes environment in globals if modules disab
6666 / ^ e n v i s n o t d e f i n e d \. \n A t t e m p t e d t o a c c e s s b i n d i n g u s i n g g l o b a l i n m o d u l e s / ,
6767 } ) ;
6868} ) ;
69- test ( "ServiceWorkerGlobalScope: includes global self-references" , ( t ) => {
70- const { globalScope } = t . context ;
71- t . is ( globalScope . global , globalScope ) ;
72- t . is ( globalScope . globalThis , globalScope ) ;
73- t . is ( globalScope . self , globalScope ) ;
74- } ) ;
7569test ( "ServiceWorkerGlobalScope: addEventListener: disabled if modules enabled" , ( t ) => {
7670 const globalScope = new ServiceWorkerGlobalScope ( new NoOpLog ( ) , { } , { } , true ) ;
7771 t . throws ( ( ) => globalScope . addEventListener ( "fetch" , ( ) => { } ) , {
@@ -109,12 +103,22 @@ test("ServiceWorkerGlobalScope: hides implementation details", (t) => {
109103 "addEventListener" ,
110104 "dispatchEvent" ,
111105 "global" ,
112- "globalThis" ,
113106 "removeEventListener" ,
114107 "self" ,
115108 ] ) ;
116109} ) ;
117110
111+ test ( "MiniflareCore: includes global self-references" , async ( t ) => {
112+ t . plan ( 2 ) ;
113+ const mf = useMiniflare (
114+ { BindingsPlugin } ,
115+ {
116+ globals : { t } ,
117+ script : "t.is(global, globalThis); t.is(self, global);" ,
118+ }
119+ ) ;
120+ await mf . getPlugins ( ) ;
121+ } ) ;
118122test ( "MiniflareCore: adds fetch event listener" , async ( t ) => {
119123 const script = `(${ ( ( ) => {
120124 const sandbox = self as any ;
0 commit comments