提交 b51203e1 编写于 作者: lizhongyi_'s avatar lizhongyi_

调整get-battery-info测试例

上级 94bad925
......@@ -7,6 +7,12 @@ describe('ExtApi-GetBatteryInfo', () => {
})
return
}
if(process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) {
it('dummyTest', () => {
expect(1).toBe(1)
})
return
}
let page;
let res;
......
......@@ -15,7 +15,7 @@ export const getBatteryInfo : GetBatteryInfo = function (options) {
// 返回数据
const res : GetBatteryInfoSuccess = {
errMsg: "getBatteryInfo:ok",
level: new Int(UIDevice.current.batteryLevel * 100),
level: Math.abs(Number(UIDevice.current.batteryLevel * 100)),
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
};
options.success?.(res);
......@@ -29,7 +29,7 @@ export const getBatteryInfoSync : GetBatteryInfoSync = function (): GetBatteryIn
// 返回数据
const res : GetBatteryInfoResult = {
level: Number(UIDevice.current.batteryLevel * 100),
level: Math.abs(Number(UIDevice.current.batteryLevel * 100)),
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
};
return res;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册