Skip to content
Advertisement

assertEqual error on nodeJs

I just started nodejs development. I am testing mongodb driver but repeatedly getting assertEquals has no method.

code from sourceRepo

JavaScript

Error

has no method ‘assertEquals’

How to reolve it?

Advertisement

Answer

You can use Node’s Assert for this (where it is called equal rather than equal*s*):

JavaScript

However, for Unit tests or something similar you should consider using some testing framework. eg. Jasmine for Node, which is very popular.

Advertisement