From 829d6f213fb00ade55df394ed13115185b38fe3a Mon Sep 17 00:00:00 2001 From: zhangfuzhi Date: Sat, 19 Nov 2022 17:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E5=A2=9E=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangfuzhi --- .../src/main/ets/test/ObserverJsunit.test.ets | 340 +++++++++--------- 1 file changed, 170 insertions(+), 170 deletions(-) diff --git a/telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets b/telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets index f8ddd66e3..a07f273dc 100644 --- a/telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets +++ b/telephony/telephonyjstest/observer/entry/src/main/ets/test/ObserverJsunit.test.ets @@ -12,13 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, expect, it } from '@ohos/hypium' -import cellular from '@ohos.telephony.data' +import { describe, expect, it } from '@ohos/hypium'; +import cellular from '@ohos.telephony.data'; import observer from '@ohos.telephony.observer'; export default function ObserverJsunit() { describe('ObserverJsunit', function () { - console.log("************* Observer Test start *************") + console.log("************* Observer Test start *************"); let envReady = false; /* @@ -27,7 +27,7 @@ export default function ObserverJsunit() { * @tc.desc : check the getCellularDataState callback to verify the call back data */ it('Telephony_observer_observer_DataConnectState_0100', 0, function (done) { - console.log("************* Telephony_observer_observer_DataConnectState_0100 Test start *************") + console.log("************* Telephony_observer_observer_DataConnectState_0100 Test start *************"); cellular.getCellularDataState((err, data) => { if (!err) { var dataConnectStateList = [cellular.DataConnectState.DATA_STATE_UNKNOWN, @@ -35,14 +35,14 @@ export default function ObserverJsunit() { cellular.DataConnectState.DATA_STATE_CONNECTING, cellular.DataConnectState.DATA_STATE_CONNECTED, cellular.DataConnectState.DATA_STATE_SUSPENDED] - expect(dataConnectStateList.indexOf(data) >= 0).assertTrue() + expect(dataConnectStateList.indexOf(data) >= 0).assertTrue(); done(); return; } console.log("Telephony_CellularData_getCellularDataState_0100 end"); - done() + done(); }) - console.log("************* Telephony_observer_observer_DataConnectState_0100 Test end *************") + console.log("************* Telephony_observer_observer_DataConnectState_0100 Test end *************"); }) /* @@ -51,18 +51,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of networkStateChange */ it('Telephony_observer_observer_on_networkStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test start *************"); try { observer.on('networkStateChange', NetworkState => { console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); - expect(typeof NetworkState === undefined).assertFalse() + expect(typeof NetworkState === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test end *************"); }) /* @@ -71,20 +71,20 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of networkStateChange */ it('Telephony_observer_observer_on_networkStateChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test start *************"); try { observer.on('networkStateChange', { slotId: 0 }, NetworkState => { console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); - expect(typeof NetworkState === undefined).assertFalse() + expect(typeof NetworkState === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test end *************") + console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test end *************"); }) /* @@ -93,22 +93,22 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of networkStateChange */ it('Telephony_observer_observer_off_networkStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test start *************"); try { let callback = NetworkState => { console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); - expect(typeof NetworkState === undefined).assertFalse() + expect(typeof NetworkState === undefined).assertFalse(); } observer.on('networkStateChange', callback); // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('networkStateChange', callback); observer.off('networkStateChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test end *************"); }) /* @@ -117,18 +117,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of signalInfoChange */ it('Telephony_observer_observer_on_signalInfoChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test start *************"); try { observer.on('signalInfoChange', SignalInformation => { console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); - expect(typeof SignalInformation === undefined).assertFalse() + expect(typeof SignalInformation === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test end *************"); }) /* @@ -137,20 +137,20 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of signalInfoChange */ it('Telephony_observer_observer_on_signalInfoChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test start *************"); try { observer.on('signalInfoChange', { slotId: 0 }, SignalInformation => { console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); - expect(typeof SignalInformation === undefined).assertFalse() + expect(typeof SignalInformation === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test end *************") + console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test end *************"); }) /* @@ -159,22 +159,22 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of signalInfoChange */ it('Telephony_observer_observer_off_signalInfoChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test start *************"); try { let callback = SignalInformation => { console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); - expect(typeof SignalInformation === undefined).assertFalse() + expect(typeof SignalInformation === undefined).assertFalse(); } observer.on('signalInfoChange', callback); // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('signalInfoChange', callback); observer.off('signalInfoChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test end *************"); }) @@ -184,19 +184,19 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of cellularDataConnectionStateChange */ it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test start *************"); try { observer.on('cellularDataConnectionStateChange', value => { console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); - expect(typeof value.state === undefined).assertFalse() - expect(typeof value.network === undefined).assertFalse() + expect(typeof value.state === undefined).assertFalse(); + expect(typeof value.network === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test end *************"); }) /* @@ -205,21 +205,21 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of cellularDataConnectionStateChange */ it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test start *************"); try { observer.on('cellularDataConnectionStateChange', { slotId: 0 }, value => { console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); - expect(typeof value.state === undefined).assertFalse() - expect(typeof value.network === undefined).assertFalse() + expect(typeof value.state === undefined).assertFalse(); + expect(typeof value.network === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test end *************") + console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test end *************"); }) /* @@ -228,7 +228,7 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of cellularDataConnectionStateChange */ it('Telephony_observer_observer_off_cellularDataConnectionStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test start *************"); try { let callback = value => { console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); @@ -237,12 +237,12 @@ export default function ObserverJsunit() { // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('cellularDataConnectionStateChange', callback); observer.off('cellularDataConnectionStateChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test end *************"); }) /* @@ -251,18 +251,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of cellularDataFlowChange */ it('Telephony_observer_observer_on_cellularDataFlowChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test start *************"); try { observer.on('cellularDataFlowChange', DataFlowType => { console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType)); - expect(typeof DataFlowType === undefined).assertFalse() + expect(typeof DataFlowType === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test end *************"); }) /* @@ -271,18 +271,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of cellularDataFlowChange */ it('Telephony_observer_observer_on_cellularDataFlowChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test start *************"); try { observer.on('cellularDataFlowChange', { slotId: 0 }, DataFlowType => { console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType)); - expect(typeof DataFlowType === undefined).assertFalse() + expect(typeof DataFlowType === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test end *************") }) @@ -293,7 +293,7 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of cellularDataFlowChange */ it('Telephony_observer_observer_off_cellularDataFlowChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test start *************"); try { let callback = data => { console.log("on cellularDataFlowChange, data:" + JSON.stringify(data)); @@ -302,10 +302,10 @@ export default function ObserverJsunit() { // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('cellularDataFlowChange', callback); observer.off('cellularDataFlowChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test end *************") }) @@ -316,18 +316,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of callStateChange */ it('Telephony_observer_observer_on_callStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test start *************"); try { observer.on('callStateChange', value => { console.log("on callStateChange, state:" + value.state + ", number:" + value.number); - expect(typeof value.state === undefined).assertFalse() + expect(typeof value.state === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test end *************"); }) /* @@ -336,20 +336,20 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of callStateChange */ it('Telephony_observer_observer_on_callStateChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test start *************"); try { observer.on('callStateChange', { slotId: 0 }, value => { console.log("on callStateChange, state:" + value.state + ", number:" + value.number); - expect(typeof value.state === undefined).assertFalse() + expect(typeof value.state === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test end *************") + console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test end *************"); }) /* @@ -358,7 +358,7 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of callStateChange */ it('Telephony_observer_observer_off_callStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test start *************"); try { let callback = value => { console.log("on callStateChange, state:" + value.state + ", number:" + value.number); @@ -367,12 +367,12 @@ export default function ObserverJsunit() { // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('callStateChange', callback); observer.off('callStateChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test end *************"); }) /* @@ -381,18 +381,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of simStateChange */ it('Telephony_observer_observer_on_simStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test start *************"); try { observer.on('simStateChange', SimStateData => { console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); - expect(typeof SimStateData === undefined).assertFalse() + expect(typeof SimStateData === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test end *************"); }) /* @@ -401,18 +401,18 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of simStateChange */ it('Telephony_observer_observer_on_simStateChange_0200', 0, async function (done) { - console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test start *************") + console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test start *************"); try { observer.on('simStateChange', { slotId: 0 }, SimStateData => { console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); - expect(typeof SimStateData === undefined).assertFalse() + expect(typeof SimStateData === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test end *************") }) @@ -423,7 +423,7 @@ export default function ObserverJsunit() { * @tc.desc : call the off method of simStateChange */ it('Telephony_observer_observer_off_simStateChange_0100', 0, async function (done) { - console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test start *************") + console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test start *************"); try { let callback = data => { console.log("on simStateChange, data:" + JSON.stringify(data)); @@ -432,12 +432,12 @@ export default function ObserverJsunit() { // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 observer.off('simStateChange', callback); observer.off('simStateChange'); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test end *************") + console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test end *************"); }) /* @@ -452,9 +452,9 @@ export default function ObserverJsunit() { return; } console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test start *************") - expect(0).assertEqual(observer.LockReason.SIM_NONE) - done() - console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test end *************") + expect(0).assertEqual(observer.LockReason.SIM_NONE); + done(); + console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test end *************"); }) /* @@ -468,10 +468,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test start *************") - expect(1).assertEqual(observer.LockReason.SIM_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test start *************"); + expect(1).assertEqual(observer.LockReason.SIM_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test end *************"); }) /* @@ -485,10 +485,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test start *************") - expect(2).assertEqual(observer.LockReason.SIM_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test start *************"); + expect(2).assertEqual(observer.LockReason.SIM_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test end *************"); }) /* @@ -502,10 +502,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test start *************") - expect(3).assertEqual(observer.LockReason.SIM_PN_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test start *************"); + expect(3).assertEqual(observer.LockReason.SIM_PN_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test end *************"); }) /* * @tc.number : Telephony_observer_LockReason_SIM_PN_PUK_0100 @@ -518,10 +518,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test start *************") - expect(4).assertEqual(observer.LockReason.SIM_PN_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test start *************"); + expect(4).assertEqual(observer.LockReason.SIM_PN_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test end *************"); }) /* @@ -535,10 +535,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test start *************") - expect(5).assertEqual(observer.LockReason.SIM_PU_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test start *************"); + expect(5).assertEqual(observer.LockReason.SIM_PU_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test end *************"); }) /* @@ -552,10 +552,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test start *************") - expect(6).assertEqual(observer.LockReason.SIM_PU_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test start *************"); + expect(6).assertEqual(observer.LockReason.SIM_PU_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test end *************"); }) /* @@ -569,10 +569,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test start *************") - expect(7).assertEqual(observer.LockReason.SIM_PP_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test start *************"); + expect(7).assertEqual(observer.LockReason.SIM_PP_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test end *************"); }) /* @@ -586,10 +586,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test start *************") - expect(8).assertEqual(observer.LockReason.SIM_PP_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test start *************"); + expect(8).assertEqual(observer.LockReason.SIM_PP_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test end *************"); }) /* @@ -603,10 +603,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test start *************") - expect(9).assertEqual(observer.LockReason.SIM_PC_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test start *************"); + expect(9).assertEqual(observer.LockReason.SIM_PC_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test end *************"); }) /* @@ -620,10 +620,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test start *************") - expect(10).assertEqual(observer.LockReason.SIM_PC_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test start *************"); + expect(10).assertEqual(observer.LockReason.SIM_PC_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test end *************"); }) /* @@ -637,10 +637,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test start *************") - expect(11).assertEqual(observer.LockReason.SIM_SIM_PIN) - done() - console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test start *************"); + expect(11).assertEqual(observer.LockReason.SIM_SIM_PIN); + done(); + console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test end *************"); }) /* @@ -654,10 +654,10 @@ export default function ObserverJsunit() { done(); return; } - console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test start *************") - expect(12).assertEqual(observer.LockReason.SIM_SIM_PUK) - done() - console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test end *************") + console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test start *************"); + expect(12).assertEqual(observer.LockReason.SIM_SIM_PUK); + done(); + console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test end *************"); }) /* @@ -666,22 +666,22 @@ export default function ObserverJsunit() { * @tc.desc : call the on method of simStateChange */ it('Telephony_Observer_SimStateData_Reason', 0, async function (done) { - console.log("************* Telephony_Observer_SimStateData_Reason Test start *************") + console.log("************* Telephony_Observer_SimStateData_Reason Test start *************"); try { observer.on('simStateChange', SimStateData => { console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); - expect(typeof SimStateData.reason === undefined).assertFalse() - expect(typeof SimStateData.state === undefined).assertFalse() - expect(typeof SimStateData.type === undefined).assertFalse() + expect(typeof SimStateData.reason === undefined).assertFalse(); + expect(typeof SimStateData.state === undefined).assertFalse(); + expect(typeof SimStateData.type === undefined).assertFalse(); }); - done() + done(); } catch (error) { - expect(false).assertTrue() - done() + expect(false).assertTrue(); + done(); } - console.log("************* Telephony_Observer_SimStateData_Reason Test end *************") + console.log("************* Telephony_Observer_SimStateData_Reason Test end *************"); }) - console.log("************* Observer Test end *************") + console.log("************* Observer Test end *************"); }) } \ No newline at end of file -- GitLab