mocha-mugshot-reporter
Advanced tools
Comparing version 1.0.4 to 1.0.5
'use strict'; | ||
const path = require('path'); | ||
/** | ||
@@ -22,4 +23,29 @@ * Generates the data received from Mocha's runner under a | ||
runner.on('test end', function(test) { | ||
var error; | ||
// Mugshot will create its rootDirectory in the directory where you run | ||
// mocha test. The reporter will create the visual-report in the same folder | ||
// and will require the images (that Mugshot created) in | ||
// statics/build/bundle.js. We need to go back two directories. | ||
const root = path.join('..', '..'), | ||
result = test.ctx.result; | ||
let error; | ||
if (result) { | ||
const baseline = result.baseline, | ||
screenshot = result.screenshot, | ||
diff = result.diff; | ||
if (baseline) { | ||
result.baseline = path.join(root, baseline); | ||
} | ||
if (screenshot) { | ||
result.screenshot = path.join(root, screenshot); | ||
} | ||
if (diff) { | ||
result.diff = path.join(root, diff); | ||
} | ||
} | ||
if (test.err !== undefined) { | ||
@@ -32,3 +58,3 @@ error = {name: test.err.name, message: test.err.message}; | ||
state: test.state, | ||
result: test.ctx.result, | ||
result: result, | ||
error: error, | ||
@@ -35,0 +61,0 @@ duration: test.duration |
{ | ||
"name": "mocha-mugshot-reporter", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Mocha reporter for the Mugshot visual regression testing lib", | ||
@@ -48,2 +48,3 @@ "main": "index.js", | ||
"file-loader": "~0.9.0", | ||
"fs-extra": "~0.24.0", | ||
"ignore-styles": "~4.0.0", | ||
@@ -55,3 +56,5 @@ "jsdom": "~9.4.1", | ||
"mocha": "~2.3.1", | ||
"mugshot": "~0.2.0", | ||
"mugshot": "~0.3.1", | ||
"mugshot-looks-same": "~1.0.0", | ||
"mugshot-webdriverio": "~1.0.0", | ||
"object-assign": "~4.0.1", | ||
@@ -74,3 +77,3 @@ "phantomjs-prebuilt": "~2.1.12", | ||
"mocha": "~2.3.1", | ||
"mugshot": "~0.2.0" | ||
"mugshot": "~0.3.0" | ||
}, | ||
@@ -77,0 +80,0 @@ "dependencies": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
2080633
40
16
44880