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

@probe.gl/test-utils

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@probe.gl/test-utils - npm Package Compare versions

Comparing version 3.0.0-alpha.3 to 3.0.0-alpha.4

9

dist/es5/browser-automation/browser-test-driver.js

@@ -217,3 +217,3 @@ "use strict";

}).then(function (result) {
if (!result.success && opts.saveOnFail) {
if (!result.success && opts.saveOnFail && result.source1) {
var filename = opts.saveAs || '[name]-failed.png';

@@ -227,6 +227,7 @@ filename = filename.replace('[name]', opts.goldenImage.replace(/\.\w+$/, ''));

headless: _this3.headless,
match: result.match,
matchPercentage: result.matchPercentage,
match: result.match || 0,
matchPercentage: result.matchPercentage || 'N/A',
success: result.success,
diffImage: result.diffImage
diffImage: result.diffImage || null,
error: result.error || null
};

@@ -233,0 +234,0 @@ }).catch(function (error) {

@@ -25,3 +25,9 @@ "use strict";

var result = diffPNGs(image1, image2, options);
return diffPNGs(image1, image2, options);
}).catch(function (error) {
return {
success: false,
error: error.message
};
}).then(function (result) {
return Object.assign(result, {

@@ -28,0 +34,0 @@ source1: source1,

@@ -152,3 +152,3 @@ import BrowserDriver from './browser-driver';

return this.page.screenshot(screenshotOptions).then(image => diffImages(image, opts.goldenImage, opts)).then(result => {
if (!result.success && opts.saveOnFail) {
if (!result.success && opts.saveOnFail && result.source1) {
let filename = opts.saveAs || '[name]-failed.png';

@@ -162,6 +162,7 @@ filename = filename.replace('[name]', opts.goldenImage.replace(/\.\w+$/, ''));

headless: this.headless,
match: result.match,
matchPercentage: result.matchPercentage,
match: result.match || 0,
matchPercentage: result.matchPercentage || 'N/A',
success: result.success,
diffImage: result.diffImage
diffImage: result.diffImage || null,
error: result.error || null
};

@@ -168,0 +169,0 @@ }).catch(error => {

@@ -5,10 +5,10 @@ import fs from 'fs';

export default function diffImages(source1, source2, options = {}) {
return Promise.all([parsePNG(source1), parsePNG(source2)]).then(([image1, image2]) => {
const result = diffPNGs(image1, image2, options);
return Object.assign(result, {
source1,
source2,
options
});
});
return Promise.all([parsePNG(source1), parsePNG(source2)]).then(([image1, image2]) => diffPNGs(image1, image2, options)).catch(error => ({
success: false,
error: error.message
})).then(result => Object.assign(result, {
source1,
source2,
options
}));
}

@@ -15,0 +15,0 @@

@@ -200,3 +200,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

}).then(function (result) {
if (!result.success && opts.saveOnFail) {
if (!result.success && opts.saveOnFail && result.source1) {
var filename = opts.saveAs || '[name]-failed.png';

@@ -210,6 +210,7 @@ filename = filename.replace('[name]', opts.goldenImage.replace(/\.\w+$/, ''));

headless: _this3.headless,
match: result.match,
matchPercentage: result.matchPercentage,
match: result.match || 0,
matchPercentage: result.matchPercentage || 'N/A',
success: result.success,
diffImage: result.diffImage
diffImage: result.diffImage || null,
error: result.error || null
};

@@ -216,0 +217,0 @@ }).catch(function (error) {

@@ -12,3 +12,9 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";

var result = diffPNGs(image1, image2, options);
return diffPNGs(image1, image2, options);
}).catch(function (error) {
return {
success: false,
error: error.message
};
}).then(function (result) {
return Object.assign(result, {

@@ -15,0 +21,0 @@ source1: source1,

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "3.0.0-alpha.3",
"version": "3.0.0-alpha.4",
"keywords": [

@@ -8,0 +8,0 @@ "integration test",

@@ -189,3 +189,3 @@ // Copyright (c) 2015 - 2017 Uber Technologies, Inc.

.then(result => {
if (!result.success && opts.saveOnFail) {
if (!result.success && opts.saveOnFail && result.source1) {
let filename = opts.saveAs || '[name]-failed.png';

@@ -197,6 +197,7 @@ filename = filename.replace('[name]', opts.goldenImage.replace(/\.\w+$/, ''));

headless: this.headless,
match: result.match,
matchPercentage: result.matchPercentage,
match: result.match || 0,
matchPercentage: result.matchPercentage || 'N/A',
success: result.success,
diffImage: result.diffImage
diffImage: result.diffImage || null,
error: result.error || null
};

@@ -203,0 +204,0 @@ })

@@ -7,10 +7,15 @@ /* global Buffer */

export default function diffImages(source1, source2, options = {}) {
return Promise.all([parsePNG(source1), parsePNG(source2)]).then(([image1, image2]) => {
const result = diffPNGs(image1, image2, options);
return Object.assign(result, {
source1,
source2,
options
});
});
return Promise.all([parsePNG(source1), parsePNG(source2)])
.then(([image1, image2]) => diffPNGs(image1, image2, options))
.catch(error => ({
success: false,
error: error.message
}))
.then(result =>
Object.assign(result, {
source1,
source2,
options
})
);
}

@@ -17,0 +22,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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