Questions tagged «jasmine-matchers»

4
toBe(true)与toBeTruthy()与toBeTrue()
之间有什么区别expect(something).toBe(true),expect(something).toBeTruthy()和expect(something).toBeTrue()? 请注意,这toBeTrue()是自定义匹配器,它是jasmine-matchers在其他有用且方便的匹配器(例如toHaveMethod()或)中引入的toBeArrayOfStrings()。 这个问题本来应该是通用的,但作为一个实际示例,我正在测试中显示的元素protractor。在这种情况下,我应该使用哪个匹配器? expect(elm.isDisplayed()).toBe(true); expect(elm.isDisplayed()).toBeTruthy(); expect(elm.isDisplayed()).toBeTrue();
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.