From 30d8f7b5b14cc5a91072287cd690b7df76af0127 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Fri, 26 May 2023 10:13:25 +0000 Subject: [PATCH] add ut about color and sar Signed-off-by: hellohyh001 Change-Id: Icc56d6f19b50337217355f28d899620b234272f0 --- .../unittest/sensor/ExampleJsunit.test.js | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) mode change 100755 => 100644 interfaces/plugin/test/unittest/sensor/ExampleJsunit.test.js diff --git a/interfaces/plugin/test/unittest/sensor/ExampleJsunit.test.js b/interfaces/plugin/test/unittest/sensor/ExampleJsunit.test.js old mode 100755 new mode 100644 index ecb7ba23..d6204578 --- a/interfaces/plugin/test/unittest/sensor/ExampleJsunit.test.js +++ b/interfaces/plugin/test/unittest/sensor/ExampleJsunit.test.js @@ -514,6 +514,66 @@ describe("SensorJsTest", function () { }, 500); }) + /* + * @tc.name:SensorJsTest_025 + * @tc.desc:verify app info is not null + * @tc.type: FUNC + * @tc.require: Issue Number + */ + it("SensorJsTest_025", 0, async function (done) { + console.info('----------------------SensorJsTest_025---------------------------'); + sensor.on(sensor.SensorId.COLOR, callback, {'interval': 100000000}); + setTimeout(() => { + sensor.off(sensor.SensorId.COLOR); + done(); + }, 500); + }) + + /* + * @tc.name:SensorJsTest_026 + * @tc.desc:verify app info is not null + * @tc.type: FUNC + * @tc.require: Issue Number + */ + it("SensorJsTest_026", 0, async function (done) { + console.info('----------------------SensorJsTest_026---------------------------'); + sensor.once(sensor.SensorId.COLOR, callback); + setTimeout(() => { + expect(true).assertTrue(); + done(); + }, 500); + }) + + /* + * @tc.name:SensorJsTest_027 + * @tc.desc:verify app info is not null + * @tc.type: FUNC + * @tc.require: Issue Number + */ + it("SensorJsTest_027", 0, async function (done) { + console.info('----------------------SensorJsTest_027---------------------------'); + sensor.on(sensor.SensorId.SAR, callback, {'interval': 100000000}); + setTimeout(() => { + sensor.off(sensor.SensorId.SAR); + done(); + }, 500); + }) + + /* + * @tc.name:SensorJsTest_028 + * @tc.desc:verify app info is not null + * @tc.type: FUNC + * @tc.require: Issue Number + */ + it("SensorJsTest_028", 0, async function (done) { + console.info('----------------------SensorJsTest_028---------------------------'); + sensor.once(sensor.SensorId.SAR, callback); + setTimeout(() => { + expect(true).assertTrue(); + done(); + }, 500); + }) + let GEOMAGNETIC_COMPONENT_YEAR_RESULT = [ [6570.3935546875, -146.3289337158203, 54606.0078125, -1.2758207321166992, 83.13726043701172, 6572.02294921875, 55000.0703125], [6554.17041015625, -87.19947052001953, 54649.078125, -0.7622424364089966, 83.16046905517578, 6554.75048828125, 55040.7734375], -- Gitee