Fix the way 'npm test' loads the library
This commit is contained in:
parent
864268abb6
commit
0fee7a395e
@ -69,7 +69,8 @@
|
|||||||
|
|
||||||
var misMatch = exports.misMatch = function(exp, act) {
|
var misMatch = exports.misMatch = function(exp, act) {
|
||||||
if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) {
|
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) {
|
} else if (exp instanceof RegExp || act instanceof RegExp) {
|
||||||
var left = ppJSON(exp), right = ppJSON(act);
|
var left = ppJSON(exp), right = ppJSON(act);
|
||||||
if (left !== right) return left + " !== " + right;
|
if (left !== right) return left + " !== " + right;
|
||||||
|
|||||||
@ -51,12 +51,12 @@
|
|||||||
var stats, modes = {
|
var stats, modes = {
|
||||||
Normal: {
|
Normal: {
|
||||||
config: {
|
config: {
|
||||||
parse: (typeof require === "undefined" ? window.acorn : require("../dist/acorn")).parse
|
parse: acorn.parse
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Loose: {
|
Loose: {
|
||||||
config: {
|
config: {
|
||||||
parse: (typeof require === "undefined" ? window.acorn : require("../dist/acorn_loose")).parse_dammit,
|
parse: acorn.parse_dammit,
|
||||||
loose: true,
|
loose: true,
|
||||||
filter: function (test) {
|
filter: function (test) {
|
||||||
var opts = test.options || {};
|
var opts = test.options || {};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user