@@ -81,6 +81,9 @@ describe('mapboxgl_VideoLayer', () => {
8181 testDiv . style . height = '500px' ;
8282 window . document . body . appendChild ( testDiv ) ;
8383 spyOn ( mapboxgl , 'Map' ) . and . callFake ( mbglmap ) ;
84+ done ( ) ;
85+ } ) ;
86+ beforeEach ( ( done ) => {
8487 map = new mapboxgl . Map ( {
8588 container : 'map' ,
8689 style : {
@@ -108,13 +111,12 @@ describe('mapboxgl_VideoLayer', () => {
108111 map . on ( 'load' , function ( ) {
109112 done ( ) ;
110113 } ) ;
111- } ) ;
112- beforeEach ( ( ) => {
113114 originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
114115 jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
115116 } ) ;
116117
117118 afterEach ( ( ) => {
119+ map = null ;
118120 jasmine . DEFAULT_TIMEOUT_INTERVAL = originalTimeout ;
119121 } ) ;
120122
@@ -293,8 +295,7 @@ describe('mapboxgl_VideoLayer', () => {
293295 } , 3000 ) ;
294296 } ) ;
295297
296- it ( 'multi videoparameter load with time' , function ( done ) {
297- spyOn ( map , 'addSource' ) ;
298+ it ( 'multi videoparameter load with time' , ( done ) => {
298299 spyOn ( map , 'addLayer' ) ;
299300 const videoLayer = new VideoLayer ( {
300301 opencv : cv ,
@@ -381,7 +382,6 @@ describe('mapboxgl_VideoLayer', () => {
381382 videoLayer . onAdd ( map ) ;
382383 setTimeout ( ( ) => {
383384 expect ( Object . keys ( videoLayer . timeParams ) . length ) . toBe ( 4 ) ;
384- expect ( map . addSource ) . toHaveBeenCalled ( ) ;
385385 expect ( map . addLayer ) . toHaveBeenCalled ( ) ;
386386 done ( ) ;
387387 } , 3000 ) ;
0 commit comments