In this simple case I've mentioned, you are right - it could be 'expect(value).toBeGreaterThan(-1)'; but what I was looking for is simply defining custom matchers. I'm new to testing and didn't know I can define my own matcher
2014-01-31 Jeff Hubbard <[email protected]>: > While I agree with the general concept (multiple matchers), that example > is a little too thin--you could solve that by doing > `expect(value).toBeGreaterThan(-1);`. It's not as clear what the intent is, > but it is correct. > > > On Thursday, January 30, 2014 1:53:39 AM UTC-8, Dorota Rupniewska wrote: >> >> Is there any possibility to have more than one matcher in the same >> 'expect'? I need to check if given value is equal or grater than 0 so it >> could be something like: expect(value).toEqual(0).or.toBeGreaterThan(0) >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "AngularJS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/bLblw9FDzKA/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/groups/opt_out.
