File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1- import { Application as PixiApplication } from 'pixi.js' ;
1+ import { Application as PixiApplication , extensions as PixiExtensions , ExtensionType } from 'pixi.js' ;
22import {
33 createContext ,
44 createRef ,
@@ -195,4 +195,24 @@ describe('Application', () =>
195195 expect ( roots . size ) . toEqual ( 0 ) ;
196196 } ) ;
197197 } ) ;
198+
199+ it ( 'loads extensions provided in the extensions prop' , async ( ) =>
200+ {
201+ const customLoader = {
202+ extension : {
203+ type : ExtensionType . LoadParser ,
204+ name : 'custom-loader' ,
205+ priority : 100 ,
206+ } ,
207+ } ;
208+
209+ const addSpy = vi . spyOn ( PixiExtensions , 'add' ) ;
210+
211+ await act ( async ( ) => render ( (
212+ < Application extensions = { [ customLoader ] } />
213+ ) ) ) ;
214+
215+ expect ( addSpy ) . toHaveBeenCalledWith ( customLoader ) ;
216+ addSpy . mockRestore ( ) ;
217+ } ) ;
198218} ) ;
You can’t perform that action at this time.
0 commit comments