gpt4 book ai didi

javascript - 'to.include' 在 'to.eventually.equal' 工作的地方不工作

转载 作者:行者123 更新时间:2023-11-30 19:57:12 24 4
gpt4 key购买 nike

我试图检查一个字符串是否存在于另一个字符串中。我正在使用下面的代码expect(actualTimeZone).to.include(employee.timeZone);

但它给出了以下错误

AssertionError: object tested must be an array, a map, an object, a set, a string, or a weakset, but object given

断言错误

但是当我尝试使用下面的代码时,它并没有抛出上面的错误expect(actualTimeZone).to.eventually.equal(employee.timeZone);

我正在使用 Cucumber 和 JavaScript 开发 Protractor 框架。有人可以帮助解决这个问题

最佳答案

我尝试使用下面的代码,它正在运行

expect(actualTimeZone).to.eventually.include(employee.timeZone);

关于javascript - 'to.include' 在 'to.eventually.equal' 工作的地方不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53866319/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com