提交 2c020568 编写于 作者: Anne_LXM's avatar Anne_LXM

Update map.test.js

上级 bef962a1
...@@ -45,9 +45,19 @@ describe('web-map', () => { ...@@ -45,9 +45,19 @@ describe('web-map', () => {
const {southwest,northeast} = regionRes; const {southwest,northeast} = regionRes;
const southwestExp ={ latitude: 39.88334279187766, longitude: 116.31050146728515 } const southwestExp ={ latitude: 39.88334279187766, longitude: 116.31050146728515 }
const northeastExp ={ latitude: 40.0149408585477, longitude: 116.56799353271484 } const northeastExp ={ latitude: 40.0149408585477, longitude: 116.56799353271484 }
// 在Safari中返回的经纬度
// southwest: { latitude: 39.64483423532459, longitude: 115.88249286914063 },
// northeast: { latitude: 40.17153735946949, longitude: 116.91246113085938 },
if(!process.env.uniTestPlatformInfo.includes('Safari')){
expect(southwest.latitude).toBeCloseTo(southwestExp.latitude, 3); expect(southwest.latitude).toBeCloseTo(southwestExp.latitude, 3);
expect(southwest.longitude).toBeCloseTo(southwestExp.longitude, 3); expect(southwest.longitude).toBeCloseTo(southwestExp.longitude, 3);
expect(northeast.latitude).toBeCloseTo(northeastExp.latitude, 3); expect(northeast.latitude).toBeCloseTo(northeastExp.latitude, 3);
expect(northeast.longitude).toBeCloseTo(northeastExp.longitude, 3); expect(northeast.longitude).toBeCloseTo(northeastExp.longitude, 3);
}else{
expect(southwest.longitude).not.toBeFalsy();
expect(southwest.latitude).not.toBeFalsy();
expect(northeastExp.longitude).not.toBeFalsy();
expect(northeastExp.latitude).not.toBeFalsy();
}
}); });
}); });
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册