@@ -6,6 +6,7 @@ import { ArrayStatistic } from '@supermapgis/iclient-common/util/ArrayStatistic'
66import { FetchRequest } from '@supermapgis/iclient-common/util/FetchRequest' ;
77import * as DataFlowServiceUtil from '../../../src/mapboxgl/services/DataFlowService' ;
88import '../../resources/WebMapV5.js' ;
9+ import { Canvg } from 'canvg' ;
910
1011function DataFlowService ( serviceUrl ) {
1112 const dataflowFeature = {
@@ -311,12 +312,9 @@ describe('mapboxgl_WebMapV2', () => {
311312 originalTimeout = jasmine . DEFAULT_TIMEOUT_INTERVAL ;
312313 jasmine . DEFAULT_TIMEOUT_INTERVAL = 50000 ;
313314 window . jsonsql = { query : ( ) => [ { } ] } ;
314- window . canvg = {
315- default : {
316- from : ( ctx , url , callback ) =>
317- Promise . resolve ( { stop : jasmine . createSpy ( 'stop' ) , start : jasmine . createSpy ( 'start' ) } )
318- }
319- } ;
315+ spyOn ( Canvg , 'from' ) . and . callFake ( ( ctx , url , callback ) =>
316+ Promise . resolve ( { stop : jasmine . createSpy ( 'stop' ) , start : jasmine . createSpy ( 'start' ) } )
317+ ) ;
320318 window . geostats = class {
321319 setSerie ( ) { }
322320 } ;
@@ -346,7 +344,6 @@ describe('mapboxgl_WebMapV2', () => {
346344 mapboxgl . CRS = undefined ;
347345 mapboxgl . proj4 = undefined ;
348346 window . jsonsql = undefined ;
349- window . canvg = undefined ;
350347 window . geostats = undefined ;
351348 window . EchartsLayer = undefined ;
352349 dataFlowServiceSpyTest = null ;
0 commit comments