如何在茉莉花中使用多重期望 [英] How to use multiple expect in jasmine

查看:73
本文介绍了如何在茉莉花中使用多重期望的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将茉莉花与jasmine-species一起使用.我正在对我的网站中的搜索进行测试. 在搜索中,用户可以选择多个条件.我想知道如何在多个条件下期望.

I am using jasmine with jasmine-species . I am making a test of search in my site . In search there are multiple criteria a user can select . I want to know that how to expect with multiple criteria.

假设这是我的情况

expect(variable1).toEqual('');
expect(variable2).toEqual('');
expect(variable3).toEqual('');
expect(variable4).toEqual('');

我的问题是我想将所有期望都移到单个期望中.茉莉花有可能吗?如果是,那怎么办?

My question is that i want to move all expects into single expect . Is this possible in jasmine ? if yes , then how ?

预先感谢

推荐答案

期望(variable1 == 1&& variable2 == 2).toBeTruthy();

expect(variable1 == 1 && variable2 == 2).toBeTruthy();

这篇关于如何在茉莉花中使用多重期望的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆