0

I need you to know how i can use AND/OR with should.js I try to do something like that :

res.body[0].color.should.equal('blue').or('red');

It is possible with should ? I find nothing in documentation..Or i'm blind.

Thanks in advance.

Charly
  • 125
  • 8

1 Answers1

1

There isn't any 'or' operator, but you could do a 'match' regexp:

res.body[0].color.should.match(/^blue$|^red$/);
Eduardo Yáñez Parareda
  • 9,126
  • 4
  • 37
  • 50