File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/modules/loader/__tests__ Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,26 @@ describe('bundle loading', () => {
5353 const promise = loadModuleBundleAsync ( 'unknown_module' , context )
5454 return expect ( promise ) . rejects . toBeInstanceOf ( ModuleConnectionError )
5555 } )
56+
57+ test ( 'Loading a bundle preserves properties' , async ( ) => {
58+ const context = mockContext ( Chapter . SOURCE_4 , Variant . DEFAULT )
59+
60+ function foo ( ) {
61+ return foo . name
62+ }
63+ foo . someprop = true
64+
65+ expect ( 'someprop' in foo ) . toEqual ( true )
66+
67+ moduleMocker . mockReturnValueOnce ( {
68+ foo,
69+ bar : ( ) => 'bar'
70+ } )
71+
72+ const mod = await loadModuleBundleAsync ( 'one_module' , context )
73+ expect ( mod . foo ( ) ) . toEqual ( 'foo' )
74+ expect ( 'someprop' in mod . foo ) . toEqual ( true )
75+ } )
5676} )
5777
5878describe ( 'tab loading' , ( ) => {
You can’t perform that action at this time.
0 commit comments