10

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.

Suppose this is my case

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 ?

Thanks in advance

1 Answer 1

24

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

1
  • 1
    So straightforward, easy to sometimes lose oneself in the API you forget to actually solve the problem with the language!
    – mccainz
    Commented Sep 12, 2018 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.