From 593f24aa109d65c4c27d3cd3781760ac29a96048 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 1 Oct 2023 21:28:54 +0200 Subject: [PATCH] Update expect-puppeteer --- package-lock.json | 28 ++++++++++++++++++---------- packages/e2e-test-utils/package.json | 2 +- packages/e2e-tests/package.json | 2 +- patches/expect-puppeteer+9.0.0.patch | 21 --------------------- 4 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 patches/expect-puppeteer+9.0.0.patch diff --git a/package-lock.json b/package-lock.json index 5d819ceb4678..57fbf4e7cbb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19616,14 +19616,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/expect-puppeteer": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-9.0.0.tgz", - "integrity": "sha512-mxejfYy6hsCpBgaUbKGZzoAy4SgzVhPkVZHuBaJ+xbt+BryolxLzdKU4HhJYH/Ooo9AWghAh7ofAkKEZQ2XzcA==", - "engines": { - "node": ">=16" - } - }, "node_modules/expect/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -39674,7 +39666,7 @@ "license": "Apache-2.0", "dependencies": { "@wordpress/url": "^3.41.0", - "expect-puppeteer": "^9.0.0" + "expect-puppeteer": "^9.0.1" }, "devDependencies": { "@percy/puppeteer": "^2.0.2" @@ -39696,6 +39688,14 @@ "node": ">=12" } }, + "packages/e2e-test-utils/node_modules/expect-puppeteer": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-9.0.1.tgz", + "integrity": "sha512-LqGzoyW4XgZbfJadjllSMCwZflX9gVBqjFUg8qde+etXr/SEFWLBgn98nRAmO3hUjMRNyh5gIFcaSi4DzHAWLw==", + "engines": { + "node": ">=16" + } + }, "packages/e2e-tests": { "name": "@web-stories-wp/e2e-tests", "license": "Apache-2.0", @@ -39706,7 +39706,7 @@ "@wordpress/jest-console": "^7.13.0", "@wordpress/jest-puppeteer-axe": "^6.13.0", "babel-jest": "^29.5.0", - "expect-puppeteer": "^9.0.0", + "expect-puppeteer": "^9.0.1", "jest-environment-puppeteer": "^9.0.0", "jest-extended": "^4.0.0", "jest-json-schema": "^6.1.0", @@ -39823,6 +39823,14 @@ "url": "https://github.com/sponsors/d-fischer" } }, + "packages/e2e-tests/node_modules/expect-puppeteer": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-9.0.1.tgz", + "integrity": "sha512-LqGzoyW4XgZbfJadjllSMCwZflX9gVBqjFUg8qde+etXr/SEFWLBgn98nRAmO3hUjMRNyh5gIFcaSi4DzHAWLw==", + "engines": { + "node": ">=16" + } + }, "packages/e2e-tests/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", diff --git a/packages/e2e-test-utils/package.json b/packages/e2e-test-utils/package.json index 0c394792c4f9..d0a7999dcaf1 100644 --- a/packages/e2e-test-utils/package.json +++ b/packages/e2e-test-utils/package.json @@ -27,7 +27,7 @@ "main": "./src/index.js", "dependencies": { "@wordpress/url": "^3.41.0", - "expect-puppeteer": "^9.0.0" + "expect-puppeteer": "^9.0.1" }, "devDependencies": { "@percy/puppeteer": "^2.0.2" diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 924860448518..ab36fafd2192 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -32,7 +32,7 @@ "@wordpress/jest-console": "^7.13.0", "@wordpress/jest-puppeteer-axe": "^6.13.0", "babel-jest": "^29.5.0", - "expect-puppeteer": "^9.0.0", + "expect-puppeteer": "^9.0.1", "jest-environment-puppeteer": "^9.0.0", "jest-extended": "^4.0.0", "jest-json-schema": "^6.1.0", diff --git a/patches/expect-puppeteer+9.0.0.patch b/patches/expect-puppeteer+9.0.0.patch deleted file mode 100644 index c4a6f5aa3542..000000000000 --- a/patches/expect-puppeteer+9.0.0.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/node_modules/expect-puppeteer/dist/index.js b/node_modules/expect-puppeteer/dist/index.js -index 9db58ab..dd27744 100644 ---- a/node_modules/expect-puppeteer/dist/index.js -+++ b/node_modules/expect-puppeteer/dist/index.js -@@ -4,13 +4,13 @@ const checkIsPuppeteerInstance = (instance)=>{ - return Boolean(instance?.constructor?.name && typeof instance === "object" && "$" in instance); - }; - const checkIsPage = (instance)=>{ -- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "CDPPage"; -+ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPPage" || instance?.constructor?.name === "CdpPage"); - }; - const checkIsFrame = (instance)=>{ -- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "Frame"; -+ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPFrame" || instance?.constructor?.name === "CdpFrame"); - }; - const checkIsElementHandle = (instance)=>{ -- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "CDPElementHandle"; -+ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPElementHandle" || instance?.constructor?.name === "CdpElementHandle"); - }; - const getContext = async (instance, pageFunction)=>{ - if (checkIsFrame(instance) || checkIsPage(instance)) {