[英]Should.js throwing JSHint warnings
I'm using should.js for assertions, however, I am getting JSHint warnings for: 我使用should.js进行断言,但是,我收到以下消息的JSHint警告:
argObject.exists(dummyString1).should.be.true;
argObject.exists(dummyString2).should.be.true;
is throwing 扔
Expected an assignment or function call and instead saw an expression.
for each line after the first. 对于第一行之后的每一行。
The solution I went for is to avoid using that syntax (I don't really like it much anyway) and rewrite the assertions as: 我寻求的解决方案是避免使用该语法(无论如何我还是不太喜欢),并将断言重写为:
argObject.exists(dummyString1).should.equal(true);
argObject.exists(dummyString2).should.equal(false);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.