What are Mocha equal tests?
I am testing an Express Node app with Mocha. I would like to have the following test (comparing two empty arrays):
assert.equal , 
to pass. However, Mocha gives me the following error:
AssertionError:  == 
Which method should I use in order for comparison of two empty arrays to pass?
That's why the test fails.
You basically have the same issues with objects (no deep-equal is done), although you often are not interested in whether two objects are identical, but whether their contents are the same.
That's why I wrote a module to handle this: comparejs. This module - besides some other nice things - solves this issue by offering comparison by value and comparison by identity, for all (!) types. I guess that's what you need here.
As you are especially asking for the context of mocha, I have also written my own assert-module, called node-assertthat, which internally makes use of comparejs. As a side effect, you get a more readable (as more fluent) syntax. Instead of
you can write
Perhaps this may be the way for you to go.
PS: I know that self-advertisement is not wanted on Stackoverflow, but in this case the tools I've written for myself simply solve the original poster's question. Hence please do not mark this answer as spam.