Skip to content

Commit 3aeccc7

Browse files
authored
Merge branch 'main' into renovate/pngjs-7.x
2 parents 86a43a9 + f240e9f commit 3aeccc7

File tree

8 files changed

+1094
-724
lines changed

8 files changed

+1094
-724
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: "16.x"
20+
node-version: "18.x"
2121
- name: Remove git auth
2222
run: git config --unset http.https://github.com/.extraheader
2323
- name: Generate yarn cache-key
@@ -52,7 +52,7 @@ jobs:
5252
- uses: actions/checkout@v3
5353
- uses: actions/setup-node@v3
5454
with:
55-
node-version: "16.x"
55+
node-version: "18.x"
5656
- name: remove git auth
5757
run: git config --unset http.https://github.com/.extraheader
5858
- name: Configure Yarn cache
@@ -79,7 +79,7 @@ jobs:
7979
- uses: actions/checkout@v3
8080
- uses: actions/setup-node@v3
8181
with:
82-
node-version: "16.x"
82+
node-version: "18.x"
8383
- name: remove git auth
8484
run: git config --unset http.https://github.com/.extraheader
8585
- name: Configure Yarn cache
@@ -110,7 +110,7 @@ jobs:
110110
- uses: actions/checkout@v3
111111
- uses: actions/setup-node@v3
112112
with:
113-
node-version: "16.x"
113+
node-version: "18.x"
114114
- name: remove git auth
115115
run: git config --unset http.https://github.com/.extraheader
116116
- name: Configure Yarn cache
@@ -126,7 +126,7 @@ jobs:
126126
run: yarn --immutable
127127
- name: Test integration (with coverage) and upload to CodeClimate
128128
if: ${{ github.ref == 'refs/heads/main' }}
129-
uses: paambaati/codeclimate-action@v3.2.0
129+
uses: paambaati/codeclimate-action@v4.0.0
130130
env:
131131
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
132132
with:
@@ -154,7 +154,7 @@ jobs:
154154
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
155155
- uses: actions/setup-node@v3
156156
with:
157-
node-version: "16.x"
157+
node-version: "18.x"
158158
- name: remove git auth
159159
run: git config --unset http.https://github.com/.extraheader
160160
- name: Configure Yarn cache

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
## [3.2.14](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.13...v3.2.14) (2023-03-26)
2+
3+
## [3.2.13](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.12...v3.2.13) (2023-03-26)
4+
5+
## [3.2.12](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.11...v3.2.12) (2023-03-26)
6+
7+
8+
### Bug Fixes
9+
10+
* import meta-png cjs dependency ([#209](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/issues/209)) ([41aeee5](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/commit/41aeee52c362e4a1817a9e364963c4aff1407d0a)), closes [#207](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/issues/207)
11+
12+
## [3.2.11](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.10...v3.2.11) (2023-03-26)
13+
14+
15+
### Bug Fixes
16+
17+
* treat maxDiffThreshold 0 as valid value ([f4d3ec9](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/commit/f4d3ec946547d648d1ec8ea9ccf9369540255adf))
18+
19+
## [3.2.10](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.9...v3.2.10) (2023-03-26)
20+
21+
22+
### Bug Fixes
23+
24+
* add missing forceDeviceScaleFactor option ([ba7d2f1](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/commit/ba7d2f15b57390bb1ef69de6f7ed979438155444))
25+
26+
## [3.2.9](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.8...v3.2.9) (2023-03-26)
27+
128
## [3.2.8](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.7...v3.2.8) (2022-12-18)
229

330
## [3.2.7](https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/compare/v3.2.6...v3.2.7) (2022-12-14)

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"@vue/cli-plugin-e2e-cypress": "5.0.8",
2121
"@vue/cli-service": "5.0.8",
2222
"cypress": "11.2.0",
23-
"typescript": "4.9.4"
23+
"typescript": "5.0.2"
2424
}
2525
}

example/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,7 +2890,7 @@ __metadata:
28902890
"@vue/cli-plugin-e2e-cypress": 5.0.8
28912891
"@vue/cli-service": 5.0.8
28922892
cypress: 11.2.0
2893-
typescript: 4.9.4
2893+
typescript: 5.0.2
28942894
vue: 3.2.45
28952895
languageName: unknown
28962896
linkType: soft
@@ -7058,23 +7058,23 @@ __metadata:
70587058
languageName: node
70597059
linkType: hard
70607060

7061-
"typescript@npm:4.9.4":
7062-
version: 4.9.4
7063-
resolution: "typescript@npm:4.9.4"
7061+
"typescript@npm:5.0.2":
7062+
version: 5.0.2
7063+
resolution: "typescript@npm:5.0.2"
70647064
bin:
70657065
tsc: bin/tsc
70667066
tsserver: bin/tsserver
7067-
checksum: e782fb9e0031cb258a80000f6c13530288c6d63f1177ed43f770533fdc15740d271554cdae86701c1dd2c83b082cea808b07e97fd68b38a172a83dbf9e0d0ef9
7067+
checksum: bef1dcd166acfc6934b2ec4d72f93edb8961a5fab36b8dd2aaf6f4f4cd5c0210f2e0850aef4724f3b4913d5aef203a94a28ded731b370880c8bcff7e4ff91fc1
70687068
languageName: node
70697069
linkType: hard
70707070

7071-
"typescript@patch:typescript@4.9.4#~builtin<compat/typescript>":
7072-
version: 4.9.4
7073-
resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin<compat/typescript>::version=4.9.4&hash=701156"
7071+
"typescript@patch:typescript@5.0.2#~builtin<compat/typescript>":
7072+
version: 5.0.2
7073+
resolution: "typescript@patch:typescript@npm%3A5.0.2#~builtin<compat/typescript>::version=5.0.2&hash=701156"
70747074
bin:
70757075
tsc: bin/tsc
70767076
tsserver: bin/tsserver
7077-
checksum: 37f6e2c3c5e2aa5934b85b0fddbf32eeac8b1bacf3a5b51d01946936d03f5377fe86255d4e5a4ae628fd0cd553386355ad362c57f13b4635064400f3e8e05b9d
7077+
checksum: bdbf3d0aac0d6cf010fbe0536753dc19f278eb4aba88140dcd25487dfe1c56ca8b33abc0dcd42078790a939b08ebc4046f3e9bb961d77d3d2c3cfa9829da4d53
70787078
languageName: node
70797079
linkType: hard
70807080

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@frsource/cypress-plugin-visual-regression-diff",
33
"description": "Perform visual regression test with a nice GUI as help. 💅 Only for Cypress!",
4-
"version": "3.2.8",
4+
"version": "3.2.14",
55
"author": "Jakub Freisler <[email protected]>",
66
"homepage": "https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff",
77
"repository": "https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff.git",
@@ -80,8 +80,8 @@
8080
"@semantic-release/commit-analyzer": "9.0.2",
8181
"@semantic-release/git": "10.0.1",
8282
"@semantic-release/github": "8.0.7",
83-
"@semantic-release/npm": "9.0.1",
84-
"@semantic-release/release-notes-generator": "10.0.3",
83+
"@semantic-release/npm": "10.0.2",
84+
"@semantic-release/release-notes-generator": "11.0.1",
8585
"@types/glob": "8.0.0",
8686
"@types/pixelmatch": "5.2.4",
8787
"@types/pngjs": "6.0.1",
@@ -100,10 +100,10 @@
100100
"microbundle": "0.15.1",
101101
"prettier": "2.8.1",
102102
"sanitize-filename": "1.6.3",
103-
"semantic-release": "20.1.0",
103+
"semantic-release": "21.0.0",
104104
"tmp-promise": "3.0.3",
105-
"typescript": "4.9.4",
106-
"vite-tsconfig-paths": "3.6.0",
105+
"typescript": "5.0.2",
106+
"vite-tsconfig-paths": "4.0.7",
107107
"vitest": "0.25.8"
108108
},
109109
"keywords": [

src/commands.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ declare global {
1616
imagesDir?: string;
1717
imagesPath?: string;
1818
maxDiffThreshold?: number;
19+
forceDeviceScaleFactor?: boolean;
1920
title?: string;
2021
matchAgainstPath?: string;
2122
// IDEA: to be implemented if support for files NOT from filesystem needed
@@ -74,9 +75,15 @@ const getImagesDir = (options: Cypress.MatchImageOptions) => {
7475

7576
export const getConfig = (options: Cypress.MatchImageOptions) => {
7677
const imagesDir = getImagesDir(options);
78+
const maxDiffThreshold =
79+
options.maxDiffThreshold ??
80+
(Cypress.env("pluginVisualRegressionMaxDiffThreshold") as
81+
| number
82+
| undefined);
7783

7884
return {
7985
scaleFactor:
86+
options.forceDeviceScaleFactor === false ||
8087
Cypress.env("pluginVisualRegressionForceDeviceScaleFactor") === false
8188
? 1
8289
: 1 / window.devicePixelRatio,
@@ -92,11 +99,7 @@ export const getConfig = (options: Cypress.MatchImageOptions) => {
9299
(Cypress.env("pluginVisualRegressionImagesPath") as string | undefined) ||
93100
"{spec_path}/__image_snapshots__",
94101
maxDiffThreshold:
95-
options.maxDiffThreshold ||
96-
(Cypress.env("pluginVisualRegressionMaxDiffThreshold") as
97-
| number
98-
| undefined) ||
99-
0.01,
102+
typeof maxDiffThreshold === "number" ? maxDiffThreshold : 0.01,
100103
diffConfig:
101104
options.diffConfig ||
102105
(Cypress.env("pluginVisualRegressionDiffConfig") as
@@ -131,7 +134,9 @@ Cypress.Commands.add(
131134
} = getConfig(options);
132135

133136
const currentRetryNumber = (
134-
cy as unknown as { state: (s: string) => { currentRetry: () => number } }
137+
cy as unknown as {
138+
state: (s: string) => { currentRetry: () => number };
139+
}
135140
)
136141
.state("test")
137142
.currentRetry();

src/image.utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import path from "path";
22
import fs from "fs";
33
import { PNG, PNGWithMetadata } from "pngjs";
44
import sharp from "sharp";
5-
import { addMetadata, getMetadata } from "meta-png";
5+
import metaPngPkg from "meta-png";
6+
const { addMetadata, getMetadata } = metaPngPkg;
67
import glob from "glob";
78
import { version } from "../package.json";
89
import { wasScreenshotUsed } from "./screenshotPath.utils";

0 commit comments

Comments
 (0)