diff --git a/README.md b/README.md index 25e64c6b..b1c52478 100644 --- a/README.md +++ b/README.md @@ -89,18 +89,18 @@ require("@frsource/cypress-plugin-visual-regression-diff"); ```ts // typescript / ES6 import { defineConfig } from "cypress"; -import { initPlugin } from "@frsource/cypress-plugin-visual-regression-diff/plugins"; +import { initPlugin as initVisualRegressionPlugin } from "@frsource/cypress-plugin-visual-regression-diff/plugins"; export default defineConfig({ // initPlugin must be called in the section where it is used: e2e or component e2e: { setupNodeEvents(on, config) { - initPlugin(on, config); + initVisualRegressionPlugin(on, config); }, }, component: { setupNodeEvents(on, config) { - initPlugin(on, config); + initVisualRegressionPlugin(on, config); }, }, }); @@ -110,24 +110,24 @@ export default defineConfig({ ```ts // typescript / ES6 -import { initPlugin } from "@frsource/cypress-plugin-visual-regression-diff/plugins"; +import { initPlugin as initVisualRegressionPlugin } from "@frsource/cypress-plugin-visual-regression-diff/plugins"; export default function ( on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions ) { - initPlugin(on, config); + initVisualRegressionPlugin(on, config); return config; } // javascript const { - initPlugin, + initPlugin: initVisualRegressionPlugin, } = require("@frsource/cypress-plugin-visual-regression-diff/plugins"); module.exports = function (on, config) { - initPlugin(on, config); + initVisualRegressionPlugin(on, config); return config; }; diff --git a/examples/next/cypress/support/e2e.ts b/examples/next/cypress/support/e2e.ts index ed5730de..e3ba3524 100644 --- a/examples/next/cypress/support/e2e.ts +++ b/examples/next/cypress/support/e2e.ts @@ -16,5 +16,18 @@ // Import commands.js using ES2015 syntax: import './commands' +Cypress.on('window:before:load', win => { + // TODO: remove when Cypress update electron to version >= 28.0.0 + win.URL.canParse = function canParse(url) { + const urlString = String(url); + const base = length < 2 || arguments[1] === undefined ? undefined : String(arguments[1]); + try { + return !!new URL(urlString, base); + } catch (error) { + return false; + } + }; +}); + // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/examples/next/package.json b/examples/next/package.json index 0693a4d5..4f680f97 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -21,7 +21,7 @@ "@types/node": "18.0.6", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", - "cypress": "12.12.0", + "cypress": "13.14.2", "start-server-and-test": "1.15.2", "typescript": "4.7.4" } diff --git a/examples/webpack/cypress.config.ts b/examples/webpack/cypress.config.ts index c3f8c966..5cd483ad 100644 --- a/examples/webpack/cypress.config.ts +++ b/examples/webpack/cypress.config.ts @@ -2,7 +2,6 @@ import { defineConfig } from "cypress"; import { initPlugin } from "@frsource/cypress-plugin-visual-regression-diff/plugins"; module.exports = defineConfig({ - video: false, e2e: { setupNodeEvents(on, config) { initPlugin(on, config); diff --git a/examples/webpack/package.json b/examples/webpack/package.json index a0d69a10..5da50e3c 100644 --- a/examples/webpack/package.json +++ b/examples/webpack/package.json @@ -19,7 +19,7 @@ "@frsource/cypress-plugin-visual-regression-diff": "workspace:*", "@vue/cli-plugin-e2e-cypress": "5.0.8", "@vue/cli-service": "5.0.8", - "cypress": "12.12.0", + "cypress": "13.14.2", "typescript": "5.0.4" } } diff --git a/package.json b/package.json index 7d819d9d..20e852dc 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,11 @@ "test:e2e:ci": "pnpm -r test:e2e:ci" }, "engines": { - "node": ">=10" + "node": ">=14" }, "packageManager": "pnpm@8.6.12", "peerDependencies": { - "cypress": ">=4.5.0" + "cypress": ">=13.0.0" }, "devDependencies": { "@frsource/eslint-config": "1.15.0", diff --git a/packages/cypress-plugin-visual-regression-diff/package.json b/packages/cypress-plugin-visual-regression-diff/package.json index bde9489d..53c4d297 100644 --- a/packages/cypress-plugin-visual-regression-diff/package.json +++ b/packages/cypress-plugin-visual-regression-diff/package.json @@ -57,11 +57,11 @@ "test:integration:ci": "CI=true vitest run --coverage" }, "engines": { - "node": ">=10" + "node": ">=14" }, "packageManager": "pnpm@8.6.12", "peerDependencies": { - "cypress": ">=4.5.0" + "cypress": ">=13.0.0" }, "devDependencies": { "@frsource/prettier-config": "^1.11.0", @@ -70,17 +70,16 @@ "@types/pngjs": "6.0.4", "@types/sharp": "0.32.0", "@types/tmp": "0.2.6", - "@vitest/coverage-c8": "0.33.0", "cpy-cli": "4.2.0", - "cypress": "12.14.0", + "cypress": "13.14.2", "del-cli": "5.0.1", "microbundle": "0.15.1", "prettier": "3.3.2", "sanitize-filename": "1.6.3", "tmp-promise": "3.0.3", - "typescript": "5.1.6", - "vite-tsconfig-paths": "4.2.1", - "vitest": "0.33.0" + "typescript": "5.6.2", + "vite-tsconfig-paths": "5.0.1", + "vitest": "2.1.1" }, "keywords": [ "Cypress", @@ -97,13 +96,13 @@ "Cypress image snapshot" ], "dependencies": { - "@frsource/base64": "1.0.30", + "@frsource/base64": "1.0.76", "glob": "8.1.0", "meta-png": "1.0.6", "move-file": "2.1.0", "pixelmatch": "5.3.0", "pngjs": "7.0.0", - "sharp": "0.32.6" + "sharp": "0.33.5" }, "publishConfig": { "access": "public" diff --git a/packages/cypress-plugin-visual-regression-diff/src/__snapshots__/support.test.ts.snap b/packages/cypress-plugin-visual-regression-diff/src/__snapshots__/support.test.ts.snap index 069b9498..86f1f504 100644 --- a/packages/cypress-plugin-visual-regression-diff/src/__snapshots__/support.test.ts.snap +++ b/packages/cypress-plugin-visual-regression-diff/src/__snapshots__/support.test.ts.snap @@ -1,33 +1,33 @@ -// Vitest Snapshot v1 +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`generateOverlayTemplate > generates proper template 1`] = ` -"
-
-