chai-contained

使用示例

var chai = require('chai')
  , expect = chai.expect
  , chaiContained = require('chai-contained');

expect('foo').to.be.containedIn(['foo', 'bar']); // will pass
expect('foo').to.be.containedIn(['noFoo', 'baz']); // will fail

后面的例子会失败,并显示以下错误信息:AssertionError: expected 'foo' to be one of the [ 'noFoo', 'baz' ]