Fix the way 'npm test' loads the library

This commit is contained in:
Marijn Haverbeke
2015-03-20 17:35:51 +01:00
parent 864268abb6
commit 0fee7a395e
2 changed files with 4 additions and 3 deletions

View File

@@ -69,7 +69,8 @@
var misMatch = exports.misMatch = function(exp, act) {
if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) {
if (exp !== act) return ppJSON(exp) + " !== " + ppJSON(act);
if (exp !== act && typeof exp != "function")
return ppJSON(exp) + " !== " + ppJSON(act);
} else if (exp instanceof RegExp || act instanceof RegExp) {
var left = ppJSON(exp), right = ppJSON(act);
if (left !== right) return left + " !== " + right;