mochawesome
Advanced tools
Comparing version 4.1.0 to 5.0.0
# mochawesome changelog | ||
## [Unreleased] | ||
### Changed | ||
- Drop support for node 8 | ||
### Fixed | ||
- Ensure a stats collector is always initialized | ||
- Omit code snippets from JSON when `code` option is `false` | ||
## [4.1.0] - 2019-08-06 | ||
@@ -6,0 +12,0 @@ ### Added |
{ | ||
"name": "mochawesome", | ||
"version": "4.1.0", | ||
"version": "5.0.0", | ||
"description": "A gorgeous reporter for Mocha.js", | ||
"scripts": { | ||
"lint": "eslint src test", | ||
"test": "npm run lint && cross-env NODE_ENV=test nyc mocha", | ||
"test:fn": "mocha test-functional/test.js --opts test-functional/mocha.opts", | ||
"test": "npm run lint && cross-env NODE_ENV=test nyc mocha --config test/.mocharc.json", | ||
"test:fn": "mocha test-functional/test.js --config test-functional/.mocharc.json", | ||
"test:prog": "node ./test-programmatic", | ||
"test:mem": "mocha test-functional/mem-test.js --opts test-functional/mocha.opts", | ||
"test:ctx": "mocha test-functional/test-context.js --opts test-functional/mocha.opts", | ||
"test:mem": "mocha test-functional/mem-test.js --config test-functional/.mocharc.json", | ||
"test:ctx": "mocha test-functional/test-context.js --config test-functional/.mocharc.json", | ||
"tdd": "npm run lint && cross-env NODE_ENV=test nyc mocha --watch", | ||
@@ -49,3 +49,3 @@ "prepack": "npm run test" | ||
"dependencies": { | ||
"chalk": "^2.4.1", | ||
"chalk": "^3.0.0", | ||
"diff": "^4.0.1", | ||
@@ -57,20 +57,20 @@ "json-stringify-safe": "^5.0.1", | ||
"lodash.isstring": "^4.0.1", | ||
"mochawesome-report-generator": "^4.0.0", | ||
"strip-ansi": "^5.0.0", | ||
"uuid": "^3.3.2" | ||
"mochawesome-report-generator": "^4.1.0", | ||
"strip-ansi": "^6.0.0", | ||
"uuid": "^7.0.0" | ||
}, | ||
"peerDependencies": { | ||
"mocha": ">=5" | ||
"mocha": ">=7" | ||
}, | ||
"devDependencies": { | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.7.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"cross-env": "^7.0.0", | ||
"eslint": "^6.5.1", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"mocha": ">=5", | ||
"nyc": "^13.1.0", | ||
"nyc": "^15.0.0", | ||
"proxyquire": "^2.1.0", | ||
"should": "^13.2.3", | ||
"sinon": "^7.0.0" | ||
"sinon": "^9.0.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ mochawesome | ||
Mochawesome is a custom reporter for use with the Javascript testing framework, [mocha][mocha]. It runs on Node.js (>=8) and works in conjunction with [mochawesome-report-generator][marge] to generate a standalone HTML/CSS report to help visualize your test runs. | ||
Mochawesome is a custom reporter for use with the Javascript testing framework, [mocha][mocha]. It runs on Node.js (>=10) and works in conjunction with [mochawesome-report-generator][marge] to generate a standalone HTML/CSS report to help visualize your test runs. | ||
@@ -8,0 +8,0 @@ |
@@ -33,2 +33,5 @@ /** | ||
const reporterOpts = (opts && opts.reporterOptions) || {}; | ||
const code = _getOption('code', reporterOpts, true, true); | ||
const noCode = _getOption('no-code', reporterOpts, true, false); | ||
return { | ||
@@ -40,4 +43,5 @@ quiet: _getOption('quiet', reporterOpts, true, false), | ||
consoleReporter: _getOption('consoleReporter', reporterOpts, false, 'spec'), | ||
useInlineDiffs: !!opts.useInlineDiffs | ||
useInlineDiffs: !!opts.useInlineDiffs, | ||
code: noCode ? false : code | ||
}; | ||
}; |
@@ -84,12 +84,15 @@ const Base = require('mocha/lib/reporters/base'); | ||
// Ensure stats collector has been initialized | ||
if (!runner.stats) { | ||
const createStatsCollector = require('mocha/lib/stats-collector'); | ||
createStatsCollector(runner); | ||
} | ||
// Reporter options | ||
const reporterOptions = Object.assign( | ||
{}, | ||
(options.reporterOptions || {}), | ||
{ | ||
reportFilename: this.config.reportFilename, | ||
saveHtml: this.config.saveHtml, | ||
saveJson: this.config.saveJson | ||
} | ||
); | ||
const reporterOptions = { | ||
...options.reporterOptions, | ||
reportFilename: this.config.reportFilename, | ||
saveHtml: this.config.saveHtml, | ||
saveJson: this.config.saveJson | ||
}; | ||
@@ -96,0 +99,0 @@ // Done function will be called before mocha exits |
@@ -151,13 +151,11 @@ const isString = require('lodash.isstring'); | ||
function cleanTest(test, config) { | ||
let code = test.body; | ||
const code = config.code ? (test.body || '') : ''; | ||
/* istanbul ignore next */ | ||
if (code === undefined) { | ||
/* istanbul ignore next: test.fn exists prior to mocha 2.4.0 */ | ||
code = test.fn ? test.fn.toString() : ''; | ||
} | ||
const fullTitle = isFunction(test.fullTitle) | ||
? stripAnsi(test.fullTitle()) | ||
: stripAnsi(test.title); | ||
const cleaned = { | ||
title: stripAnsi(test.title), | ||
fullTitle: isFunction(test.fullTitle) ? stripAnsi(test.fullTitle()) : /* istanbul ignore next */ stripAnsi(test.title), | ||
fullTitle, | ||
timedOut: test.timedOut, | ||
@@ -263,3 +261,3 @@ duration: test.duration || 0, | ||
}, []); | ||
const toBeCleaned = Object.assign({}, suite, { suites }); | ||
const toBeCleaned = { ...suite, suites }; | ||
return cleanSuite(toBeCleaned, totalTestsReg, config); | ||
@@ -266,0 +264,0 @@ } |
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
40603
615
+ Addedchalk@3.0.0(transitive)
+ Addeduuid@7.0.3(transitive)
- Removeduuid@3.4.0(transitive)
Updatedchalk@^3.0.0
Updatedstrip-ansi@^6.0.0
Updateduuid@^7.0.0