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

testcafe-blink-diff

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-blink-diff - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

dist/reporter.iife.min.js

6

lib/builder.js

@@ -176,3 +176,3 @@ const wargs = require('wargs');

diff.run((error, result) => {
process.stdout.write(` ${groupedName} (${error ? 'FAILED' : 'OK'})\n`);
process.stdout.write(` ${groupedName} ${error ? 'FAILED' : 'DONE'}\n`);

@@ -184,3 +184,3 @@ if (error) {

const fixed = ((result.differences / result.dimension) * 100).toFixed(2);
const errorMessage = `Failed '${groupedName}', diff: ${fixed}%`;
const errorMessage = `Failed with ${fixed}% of differences`;

@@ -229,3 +229,3 @@ if (!ok && !argv.flags.force) {

.replace('/* json */', JSON.stringify(reportInfo))
.replace('/* code */', `!function() { ${readFile('dist/reporter.iife.js')} }()`);
.replace('/* code */', readFile('dist/reporter.iife.min.js'));
}

@@ -232,0 +232,0 @@

@@ -15,2 +15,6 @@ const path = require('path');

function debug(message) {
console.warn(`[testcafe-blink-diff] ${message}`);
}
function normalize(value) {

@@ -47,9 +51,25 @@ return value

const selectors = Array.isArray(options.blockOut) ? options.blockOut : [options.blockOut];
const results = await Promise.all(selectors.map(x => {
const results = [];
await Promise.all(selectors.map(async x => {
if (typeof x !== 'function') {
console.warn(`[testcafe-blink-diff] Expecting a Selector() instance, given '${x}'`);
debug(`Expecting a Selector() instance, given '${x}'`);
return;
}
return x().then(result => result && result.boundingClientRect);
let result;
try {
result = await x.with({ boundTestRun: t });
} catch (e) {
// do nothing
} finally {
if (!result) {
const key = Object.getOwnPropertySymbols(x)[0];
debug(`Selector('${x[key].fn}') was not found on the DOM`);
}
results.push(result.boundingClientRect);
}
}));

@@ -56,0 +76,0 @@

{
"name": "testcafe-blink-diff",
"version": "0.3.2",
"version": "0.3.3",
"description": "Visual regression for Testcafé through BlinkDiff",

@@ -14,7 +14,7 @@ "main": "lib/index.js",

"lib/builder.js",
"dist/reporter.iife.js"
"dist/reporter.iife.min.js"
],
"scripts": {
"dist": "mkdir -p dist && npm run build",
"build": "bili --format iife --js buble --name reporter"
"build": "bili --target node --format iife-min --js buble --name reporter"
},

@@ -21,0 +21,0 @@ "author": "Alvaro Cabrera <pateketrueke@gmail.com>",

Sorry, the diff of this file is not supported yet

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