Eduard
Eduard

Reputation: 9165

Mocha error: undefined is not a constructor (evaluating)

I have this line of code in my unit testing function with Mocha + Chai:

const result = <div>Hello</div>
getHelloDiv().should.be.equal.to(result)

But when I run Mocha, I get:

undefined is not a constructor (evaluating 'getHelloDiv().should.be.equal.to(result)')

Upvotes: 0

Views: 290

Answers (1)

Eduard
Eduard

Reputation: 9165

Correcting this:

getHelloDiv().should.be.equal.to(result)

to this:

getHelloDiv().should.equal(result)

solved the issue.

Upvotes: 1

Related Questions