Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-mugshot-reporter

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-mugshot-reporter - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

30

lib/data-generator.js
'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

9

package.json
{
"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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc