Skip to content

Commit b6b8cc3

Browse files
committed
【fix】UT
1 parent 2ba61fd commit b6b8cc3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/mapboxgl/services/DatasourceServiceSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('mapboxgl_DatasourceService', () => {
2222
//获取数据源集服务
2323
it('success:getDatasources', (done) => {
2424
var service = new DatasourceService(url, options);
25-
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, options) => {
25+
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, undefined, options) => {
2626
expect(method).toBe("GET");
2727
expect(testUrl).toBe(url+"/datasources");
2828
expect(options).not.toBeNull();
@@ -50,7 +50,7 @@ describe('mapboxgl_DatasourceService', () => {
5050
//数据源信息查询服务成功事件
5151
it('success:getDatasource', (done) => {
5252
var service = new DatasourceService(url, options);
53-
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, options) => {
53+
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, undefined, options) => {
5454
expect(method).toBe("GET");
5555
expect(testUrl).toBe(url+"/datasources/name/World");
5656
expect(options).not.toBeNull();
@@ -79,7 +79,7 @@ describe('mapboxgl_DatasourceService', () => {
7979
//数据源信息查询服务失败事件
8080
it('fail:getDatasource', (done) => {
8181
var service = new DatasourceService(url, options);
82-
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, options) => {
82+
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, undefined, options) => {
8383
expect(method).toBe("GET");
8484
expect(testUrl).toBe(url+"/datasources/name/World1");
8585
expect(options).not.toBeNull();

test/mapboxgl/services/NetworkAnalystServiceSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('mapboxgl_NetworkAnalystService', () => {
4444
isUncertainDirectionValid: false
4545
});
4646
var service = new NetworkAnalystService(url, options);
47-
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, options) => {
47+
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl, {}, options) => {
4848
expect(method).toBe("GET");
4949
expect(testUrl).toBe(url + "/burstAnalyse");
5050
expect(options.withCredentials).toBeNull();

test/openlayers/services/NetworkAnalystServiceSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('openlayers_NetworkAnalystService', () => {
116116
spyOn(FetchRequest, 'commit').and.callFake((method, testUrl,options) => {
117117
expect(method).toBe("GET");
118118
expect(testUrl).toBe(url + "/weightmatrix");
119-
expect(options.withCredentials).toBeNull();
119+
expect(options.withCredentials).toBeUndefined();
120120
return Promise.resolve(new Response(`[[0,42],[42,0]]`));
121121
});
122122
service.computeWeightMatrix(computeWeightMatrixParameters, (result) => {

0 commit comments

Comments
 (0)