首页 文章

邮递员反应测试中的OR运算符

提问于
浏览
0

我在邮差脚本测试中有以下断言,但由于某种原因,当缺少以下其中一项时,测试失败:我的回复正文中有租约,财务或现金 . 是“||”不是OR运算符?

tests [“Deal Type”] = responseBody.has(“Lease”||“Finance”||“Cash”);

1 回答

  • 2

    根据postman docs,正确的语法将是

    tests["Deal Type"] = responseBody.has("Lease") || responseBody.has("Finance") || responseBody.has("Cash");
    

相关问题