mochawesome
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -13,3 +13,2 @@ /*jshint loopfunc: true */ | ||
var Base = mocha.reporters.Base, | ||
utils = mocha.utils, | ||
generateReport = reportGen.generateReport, | ||
@@ -241,3 +240,3 @@ saveToFile = reportGen.saveToFile; | ||
if(test.fn){ | ||
code = utils.clean(test.fn.toString()); | ||
code = cleanCode(test.fn.toString()); | ||
code = Highlight.highlightAuto(code, ['javascript']).value; | ||
@@ -269,2 +268,22 @@ } | ||
/** | ||
* Strip the function definition from `str`, | ||
* and re-indent for pre whitespace. | ||
*/ | ||
function cleanCode (str) { | ||
str = str | ||
.replace(/\r\n?|[\n\u2028\u2029]/g, '\n').replace(/^\uFEFF/, '') | ||
.replace(/^function *\(.*\) *{|\(.*\) *=> *{?/, '') | ||
.replace(/\s+\}$/, ''); | ||
var spaces = str.match(/^\n?( *)/)[1].length, | ||
tabs = str.match(/^\n?(\t*)/)[1].length, | ||
re = new RegExp('^\n?' + (tabs ? '\t' : ' ') + '{' + (tabs ? tabs : spaces) + '}', 'gm'); | ||
str = str.replace(re, ''); | ||
str = str.replace(/^\s+|\s+$/g, ''); | ||
return str; | ||
} | ||
/** | ||
* Remove all properties from an object except | ||
@@ -278,3 +297,3 @@ * those that are in the propsToKeep array. | ||
function removeAllPropsFromObjExcept(obj, propsToKeep) { | ||
function removeAllPropsFromObjExcept (obj, propsToKeep) { | ||
_.forOwn(obj, function(val, prop) { | ||
@@ -294,3 +313,3 @@ if (propsToKeep.indexOf(prop) === -1) { | ||
function _getPercentClass(pct) { | ||
function _getPercentClass (pct) { | ||
if (pct <= 50) { | ||
@@ -297,0 +316,0 @@ return 'danger'; |
{ | ||
"name": "mochawesome", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A Gorgeous HTML/CSS Reporter for Mocha.js", | ||
@@ -28,3 +28,3 @@ "scripts": { | ||
"lodash": "^3.1.0", | ||
"mocha": "^2.1.0", | ||
"mocha": "*", | ||
"moment": "^2.9.0", | ||
@@ -31,0 +31,0 @@ "ncp": "^1.0.1", |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
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
1110838
2537
1
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-colors@4.1.3(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbrowser-stdout@1.3.1(transitive)
+ Addedcamelcase@6.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddecamelize@4.0.0(transitive)
+ Addeddiff@5.2.0(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat@5.0.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@5.1.69.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedmocha@11.0.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedserialize-javascript@6.0.2(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.08.1.1(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedworkerpool@6.5.1(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
+ Addedyargs-unparser@2.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removedcommander@0.6.12.3.0(transitive)
- Removeddebug@2.2.0(transitive)
- Removeddiff@1.4.0(transitive)
- Removedescape-string-regexp@1.0.2(transitive)
- Removedglob@3.2.11(transitive)
- Removedgrowl@1.9.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjade@0.26.3(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.3.0(transitive)
- Removedminimist@0.0.8(transitive)
- Removedmkdirp@0.3.00.5.1(transitive)
- Removedmocha@2.5.3(transitive)
- Removedms@0.7.1(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedsupports-color@1.2.0(transitive)
- Removedto-iso-string@0.0.2(transitive)
Updatedmocha@*