我已经面对陌生的断言问题,所以即使是成功的断言标记为失败,就像这样:Asse田:预计[真]是真实的
this.expect(this.getWidget('contacts').isNamesDisplayed()).to.eventually.be.true.and.notify(next);
并在控制台中我有:
1 scenario (1 passed) 4 steps (4 passed) 0m03.618s [17:06:38] E/launcher - expected [ true ] to be true [17:06:38] E/launcher - AssertionError: expected [ true ] to be true
正如你在这种情况下所看到的那样,尽管断言失败,但测试标记为成功,但在'失败'断言之后还有另一个失败。
我正在使用量角器和柴的最后版本。
我检查过,你的代码失败: AssertionError:expected [true]等于[true] –
已更新我的回答。使用'to.eql()'而不是'to.Equal()'。有关'to.eql()'[http://chaijs.com/api/bdd/#arguments-section]的更多信息 –
谢谢,它的工作原理。 –