From 0989aec4f7875fbcf29153eaf3cfceccdf6665c6 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 15:15:34 +0000 Subject: [PATCH 1/3] Update webextension-polyfill to version 0.9.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c46c79c967..01461e4e47 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "stream": "^0.0.2", "tailwindcss": "^3.0.24", "uuid": "^8.3.2", - "webextension-polyfill": "^0.8.0", + "webextension-polyfill": "^0.9.0", "zustand": "^3.7.2" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 138fc985d9..374773cfab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17192,10 +17192,10 @@ web-namespaces@^1.0.0: resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.4.tgz" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== -webextension-polyfill@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.8.0.tgz#f80e9f4b7f81820c420abd6ffbebfa838c60e041" - integrity sha512-a19+DzlT6Kp9/UI+mF9XQopeZ+n2ussjhxHJ4/pmIGge9ijCDz7Gn93mNnjpZAk95T4Tae8iHZ6sSf869txqiQ== +webextension-polyfill@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.9.0.tgz#de6c1941d0ef1b0858b20e9c7b46bbc042c5a960" + integrity sha512-LTtHb0yR49xa9irkstDxba4GATDAcDw3ncnFH9RImoFwDlW47U95ME5sn5IiQX2ghfaECaf6xyXM8yvClIBkkw== webidl-conversions@^5.0.0: version "5.0.0" From 83e75dbc07fcaff6e746bfed4e64b685b7306b6b Mon Sep 17 00:00:00 2001 From: escapedcat Date: Wed, 4 May 2022 09:36:06 +0800 Subject: [PATCH 2/3] chore: support webextension-polyfill-0.9.0 --- jest.setup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jest.setup.ts b/jest.setup.ts index 1dd407a63e..d1ede233e0 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -1,3 +1,8 @@ +// avoid "This script should only be loaded in a browser extension." issue +// https://github.com/clarkbw/jest-webextension-mock/issues/149#issuecomment-1116307310 +if (!chrome.runtime) chrome.runtime = {}; +if (!chrome.runtime.id) chrome.runtime.id = "history-delete"; + // jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) From a87efcebc2e59b381f48fef7a74d3ff789e28d0b Mon Sep 17 00:00:00 2001 From: escapedcat Date: Wed, 4 May 2022 10:09:27 +0800 Subject: [PATCH 3/3] chore: adjust TS eslint rules --- .eslintrc.json | 3 ++- jest.setup.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index e459f401d5..c04f0a5221 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,7 +19,8 @@ }, "rules": { "react/prop-types": "off", - "@typescript-eslint/no-unused-vars":["warn", { "args": "none" }] // No warnings for unused function arguments, which might be used in the future. + "@typescript-eslint/no-unused-vars":["warn", { "args": "none" }], // No warnings for unused function arguments, which might be used in the future. + "@typescript-eslint/ban-ts-comment": ["off", {"ts-ignore": "allow-with-description"}] }, "settings": { "react": { diff --git a/jest.setup.ts b/jest.setup.ts index d1ede233e0..c53b6b22fa 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -1,6 +1,8 @@ // avoid "This script should only be loaded in a browser extension." issue // https://github.com/clarkbw/jest-webextension-mock/issues/149#issuecomment-1116307310 +// @ts-ignore: chrome available during tests via jest-webextension-mock if (!chrome.runtime) chrome.runtime = {}; +// @ts-ignore: chrome available during tests via jest-webextension-mock if (!chrome.runtime.id) chrome.runtime.id = "history-delete"; // jest-dom adds custom jest matchers for asserting on DOM nodes.