我正在使用Karma / Jasmine对Ionic2进行单元测试。 如何编写ion-title和ion-content的规范?它与我为 h4 标签写的方式类似吗?
我们可以在测试中使用自定义模拟器吗? 的 homePage.html
"Sun May 28 2017 09:30:00 GMT+1000 (AEST)"
homePage.spec.ts
<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
The world is your oyster.
<p>
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will be your guide.
</p>
<h4>Testing</h4>
</ion-content>
答案 0 :(得分:0)
写一个类似的断言来检查标题是否与内容相匹配......例如&#39; Ionic Blank&#39;
[{"placeid":1,"place_name":"arora-square","city":"miami","state":"florida","country":"US"}, {"placeid":2,"place_name":"hoover","city":"palo-alto","state":"california","country":"US"}