Skip to content

Commit

Permalink
Selective diffing for nightwach
Browse files Browse the repository at this point in the history
  • Loading branch information
ebekebe committed May 22, 2024
1 parent acc3725 commit 7ab1392
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const EventEmitter = require('events').EventEmitter;
const { ensureError, getFullPageConfig } = require('@saucelabs/visual');
const {
ensureError,
getFullPageConfig,
selectiveRegionsToRegionIn,
} = require('@saucelabs/visual');
const { parseIgnoreOptions, toIgnoreRegionIn } = require('../../utils/regions');
const { getMetaInfo, getVisualApi } = require('../../utils/api');
const { VISUAL_BUILD_ID_KEY } = require('../../utils/constants');
Expand Down Expand Up @@ -49,6 +53,13 @@ module.exports = class SauceVisualCheck extends EventEmitter {
? await toIgnoreRegionIn(resolvedIgnoreOptions)
: [];
//
// Regions
const regions = await selectiveRegionsToRegionIn(
options.regions ?? [],
toIgnoreRegionIn,
);
ignoreRegions.push(...regions);
//
// Get more info about the session
const {
capabilities,
Expand Down
10 changes: 5 additions & 5 deletions visual-js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@saucelabs/cypress-visual-plugin@workspace:visual-cypress"
dependencies:
"@saucelabs/visual": 0.4.0
"@saucelabs/visual": 0.5.0
"@tsconfig/node18": ^2.0.1
"@types/cypress": ^1.1.3
"@types/node": ^20.4.4
Expand Down Expand Up @@ -2858,7 +2858,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@saucelabs/nightwatch-sauce-visual-service@workspace:visual-nightwatch"
dependencies:
"@saucelabs/visual": 0.4.0
"@saucelabs/visual": 0.5.0
chalk: ^4.1.2
concurrently: ^8.2.2
eslint: ^8.0.1
Expand All @@ -2876,7 +2876,7 @@ __metadata:
resolution: "@saucelabs/visual-storybook@workspace:visual-storybook"
dependencies:
"@jest/globals": ^28.0.0 || ^29.0.0
"@saucelabs/visual": 0.4.0
"@saucelabs/visual": 0.5.0
"@storybook/test-runner": ">=0.13.0"
"@storybook/types": ^8.0.2
"@tsconfig/node18": ^2.0.0
Expand Down Expand Up @@ -2904,7 +2904,7 @@ __metadata:
languageName: unknown
linkType: soft

"@saucelabs/visual@0.4.0, @saucelabs/visual@workspace:visual":
"@saucelabs/visual@0.5.0, @saucelabs/visual@workspace:visual":
version: 0.0.0-use.local
resolution: "@saucelabs/visual@workspace:visual"
dependencies:
Expand Down Expand Up @@ -2949,7 +2949,7 @@ __metadata:
resolution: "@saucelabs/wdio-sauce-visual-service@workspace:visual-wdio"
dependencies:
"@jest/globals": ^29.7.0
"@saucelabs/visual": 0.4.0
"@saucelabs/visual": 0.5.0
"@tsconfig/node18": ^2.0.0
"@types/jest": ^29.5.6
"@typescript-eslint/eslint-plugin": ^5.59.1
Expand Down

0 comments on commit 7ab1392

Please sign in to comment.