茉莉花测试案例

时间:2017-09-08 16:49:35

标签: javascript jasmine

我是茉莉花的新手,我需要为以下代码编写代码覆盖率:

spyOn(company.LoginData,'isUserLogged').and.returnValue(true);

如何在jasmine测试用例中覆盖customerAddress和regionCode变量?

var regionCode = company.Utils.getRegionCodeFromMapping(company.regionFromPagePath.toUpperCase());
    // In case the user is logged in.
    if (company.LoginData.isUserLogged()) {
        var customer = company.LoginData.data.userProfile.customer;
        var customerAddress = !_.isUndefined(customer.address[0]) ? customer.address[0] : customer.address;
        regionCode = customerAddress.countryName.code;
    }

0 个答案:

没有答案