compare-module-exports
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "compare-module-exports", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,3 +14,3 @@ function generate(libraryName) { | ||
function test(a, b, file, name) { | ||
function test(a, b, file, name, options) { | ||
if (!b) { | ||
@@ -25,7 +25,9 @@ throw new Error(libraryName + ': mocked export "' + name + '" does not exists in ' + file); | ||
if (typeOfA === 'function') { | ||
return testFunction(a, b, file, name); | ||
if (!options.noFunctionCompare) { | ||
return testFunction(a, b, file, name); | ||
} | ||
} | ||
} | ||
function matchExports(realExports, mockedExports, realFile, mockFile) { | ||
function matchExports(realExports, mockedExports, realFile, mockFile, options = {}) { | ||
hasError = false; | ||
@@ -43,3 +45,3 @@ const typeOfA = typeof mockedExports; | ||
try { | ||
test(mockedExports, realExports, realFile, 'exports'); | ||
test(mockedExports, realExports, realFile, 'exports', options); | ||
} catch (e) { | ||
@@ -52,3 +54,3 @@ console.error(e.message, '\n'); | ||
try { | ||
test(mockedExports[key], realExports[key], realFile, key) | ||
test(mockedExports[key], realExports[key], realFile, key, options) | ||
} catch (e) { | ||
@@ -55,0 +57,0 @@ console.error(e.message, '\n'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3555
57