提交 a52c2e68 编写于 作者: R r00559040

修改error变量未声明就使用问题

Signed-off-by: Nr00559040 <ry.renyi@huawei.com>
上级 a7490811
...@@ -78,7 +78,7 @@ export default function getAbilityLabelJsUnit() { ...@@ -78,7 +78,7 @@ export default function getAbilityLabelJsUnit() {
*/ */
it('getAbilityLabel_test_0300', 0, async function (done) { it('getAbilityLabel_test_0300', 0, async function (done) {
await Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME).then((data) => { await Bundle.getAbilityLabel(BUNDLE_NAME, SERVICE_ABILITY_NAME).then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
expect(error).assertEqual(1); expect(error).assertEqual(1);
}); });
...@@ -97,14 +97,14 @@ export default function getAbilityLabelJsUnit() { ...@@ -97,14 +97,14 @@ export default function getAbilityLabelJsUnit() {
it('getAbilityLabel_test_0400', 0, async function (done) { it('getAbilityLabel_test_0400', 0, async function (done) {
let timeOldStamp = await Utils.getNowTime(); let timeOldStamp = await Utils.getNowTime();
await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR).then((data) => { await Bundle.getAbilityLabel(BUNDLE_NAME_ERROR, ABILITY_NAME_ERROR).then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
let timeNewStamp = Utils.getNowTime(); let timeNewStamp = Utils.getNowTime();
Utils.getDurationTime('[getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp); Utils.getDurationTime('[getAbilityLabel_test_0400]', timeOldStamp, timeNewStamp);
expect(error).assertEqual(1); expect(error).assertEqual(1);
}); });
await Bundle.getAbilityLabel("", "").then((data) => { await Bundle.getAbilityLabel("", "").then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
expect(error).assertEqual(1); expect(error).assertEqual(1);
}); });
...@@ -129,17 +129,17 @@ export default function getAbilityLabelJsUnit() { ...@@ -129,17 +129,17 @@ export default function getAbilityLabelJsUnit() {
*/ */
it('getAbilityLabel_test_0500', 0, async function (done) { it('getAbilityLabel_test_0500', 0, async function (done) {
await Bundle.getAbilityLabel(undefined, OTHER_ABILITY_NAME).then((data) => { await Bundle.getAbilityLabel(undefined, OTHER_ABILITY_NAME).then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
expect(error).assertEqual(2); expect(error).assertEqual(2);
}); });
await Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, undefined).then((data) => { await Bundle.getAbilityLabel(OTHER_BUNDLE_NAME, undefined).then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
expect(error).assertEqual(2); expect(error).assertEqual(2);
}); });
await Bundle.getAbilityLabel(undefined, undefined).then((data) => { await Bundle.getAbilityLabel(undefined, undefined).then((data) => {
expect(error).assertFail(); expect(data).assertFail();
}).catch((error) => { }).catch((error) => {
expect(error).assertEqual(2); expect(error).assertEqual(2);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册