Skip to content

Commit 34b1d68

Browse files
user nameluoxiao-supermap
authored andcommitted
修复ci mapbox webmap ut报错
1 parent ab6fbcd commit 34b1d68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/mapboxgl/mapping/WebMapSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ describe('mapboxgl_WebMap', () => {
105105
return Promise.resolve();
106106
});
107107
var datavizWebmap = new WebMap(id, options);
108-
setTimeout(() => {
108+
datavizWebmap.on('addlayerssucceeded', () => {
109109
datavizWebmap.setWebMapOptions({ server: 'http://www.test.com' });
110110
expect(datavizWebmap.server).toEqual('http://www.test.com/');
111111
done();
112-
}, 0);
112+
})
113113
});
114114
it('setMapOptions', (done) => {
115115
spyOn(FetchRequest, 'get').and.callFake((url) => {
@@ -129,10 +129,10 @@ describe('mapboxgl_WebMap', () => {
129129
maxZoom: 12,
130130
isWorldCopy: true
131131
};
132-
setTimeout(() => {
132+
datavizWebmap.on('addlayerssucceeded', () => {
133133
datavizWebmap.setMapOptions(mapOptions);
134134
done();
135-
}, 0);
135+
});
136136
});
137137
it('initialize_TIANDITU_IMAGE', (done) => {
138138
spyOn(FetchRequest, 'get').and.callFake((url) => {

0 commit comments

Comments
 (0)