[英]Mocha error: undefined is not a constructor (evaluating)
I have this line of code in my unit testing function with Mocha + Chai: 我在Mocha + Chai的单元测试功能中有以下代码行:
const result = <div>Hello</div>
getHelloDiv().should.be.equal.to(result)
But when I run Mocha, I get: 但是当我运行Mocha时,我得到:
undefined is not a constructor (evaluating 'getHelloDiv().should.be.equal.to(result)')
Correcting this: 更正此:
getHelloDiv().should.be.equal.to(result)
to this: 对此:
getHelloDiv().should.equal(result)
solved the issue. 解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.