In fact, this would be a great example for the case I'm trying to make.

Using a function like this to test, you would only know that the two messages aren't equal.

Replacing all theses lines by assert(message1.path === message2.path, "Paths aren't equals"), you would know that the paths are not equal and the different values of each paths, which make for more expressive tests and ease debugging.