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

@saucelabs/visual

Package Overview
Dependencies
Maintainers
0
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saucelabs/visual - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

build/chunk-HCXPB4M2.js

2

build/cli.js

@@ -6,3 +6,3 @@ #!/usr/bin/env node

getApi
} from "./chunk-EUF6NEHT.js";
} from "./chunk-HCXPB4M2.js";
import "./chunk-3IT7HMR5.js";

@@ -9,0 +9,0 @@

@@ -39,3 +39,3 @@ import {

selectiveRegionsToRegionInSync
} from "./chunk-EUF6NEHT.js";
} from "./chunk-HCXPB4M2.js";
import "./chunk-3IT7HMR5.js";

@@ -47,2 +47,3 @@

import * as os from "os";
import { backOff } from "exponential-backoff";
var getFullPageConfig = async (main, local, getId) => {

@@ -202,2 +203,43 @@ const isNoConfig = !main && !local;

};
var getVisualResults = async (api, filter) => {
const { buildId, diffIds } = filter;
const initialStatusSummary = {
["APPROVED" /* Approved */]: 0,
["EQUAL" /* Equal */]: 0,
["UNAPPROVED" /* Unapproved */]: 0,
["REJECTED" /* Rejected */]: 0,
["QUEUED" /* Queued */]: 0,
["ERRORED" /* Errored */]: 0
};
if (!buildId) {
throw new Error(
"No Sauce Visual build present, cannot determine visual results."
);
}
if (diffIds.length === 0) {
return initialStatusSummary;
}
return await backOff(
async () => {
const summary = { ...initialStatusSummary };
const diffsForTestResult = await api.diffsForTestResult(buildId);
if (!diffsForTestResult) {
return summary;
}
const filterDiffsById = (diff) => diffIds.includes(diff.id);
const statusSummary = diffsForTestResult.nodes.filter(filterDiffsById).reduce((statusSummary2, diff) => {
statusSummary2[diff.status]++;
return statusSummary2;
}, summary);
if (statusSummary["QUEUED" /* Queued */] > 0) {
throw new Error("Some diffs are still in the queued state.");
}
return statusSummary;
},
{
maxDelay: 1e4,
numOfAttempts: 10
}
);
};
export {

@@ -242,2 +284,3 @@ BaselinesOrderBy,

getFullPageConfig,
getVisualResults,
isElementIn,

@@ -244,0 +287,0 @@ isIgnoreRegion,

{
"name": "@saucelabs/visual",
"description": "JS client bindings for Sauce Labs Visual",
"version": "0.9.0",
"version": "0.10.0",
"main": "build/index.cjs",

@@ -46,3 +46,2 @@ "module": "build/index.js",

"@graphql-typed-document-node/core": "3.2.0",
"@jest/globals": "^29.5.0",
"arktype": "^1.0.29-alpha",

@@ -53,2 +52,3 @@ "axios": "^1.7.4",

"commander": "^12.0.0",
"exponential-backoff": "^3.1.1",
"proxy-agent": "^6.3.1"

@@ -74,2 +74,3 @@ },

"@graphql-codegen/client-preset": "^3.0.1",
"@jest/globals": "^29.5.0",
"@tsconfig/node18": "^2.0.0",

@@ -76,0 +77,0 @@ "@types/argparse": "^2.0.14",

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 too big to display

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