使用 AND/OR 和 Should.js(超级测试)

Use AND/OR with Should.js (supertest)

我需要你知道我如何使用 AND/OR 和 should.js 我尝试做类似的事情:

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

应该可以吗?我在文档中找不到任何内容..或者我是瞎子。

提前致谢。

没有任何 'or' 运算符,但您可以使用 'match' 正则表达式:

res.body[0].color.should.match(/^blue$|^red$/);