[英]Using should.js how to check whether a string is not present in an array?
想检查数组中是否存在字符串,我们会执行someArray.should.contain('str')
,但我找不到对此进行的否定案例检查。
Using .not
should work: someArray.should.not.contain('str')
用
.not
应该工作: someArray.should.not.contain('str')
The should.js
README does not mention .contain()
. should.js
README没有提到.contain()
。 So if simply inserting .not
does not work, use .containEql()
. 因此,如果简单地插入
.not
不工作,使用.containEql()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.