From 1860138a049b777b42adc7d8e51e1d1ad60f02f2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:50:15 +0000 Subject: [PATCH 1/2] chore(deps): update external major --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3f99c3d7..82a445c5 100644 --- a/package.json +++ b/package.json @@ -81,15 +81,15 @@ "@semantic-release/exec": "6.0.3", "@semantic-release/git": "10.0.1", "@semantic-release/npm": "12.0.1", - "@typescript-eslint/eslint-plugin": "7.18.0", - "@typescript-eslint/parser": "7.18.0", + "@typescript-eslint/eslint-plugin": "8.2.0", + "@typescript-eslint/parser": "8.2.0", "c8": "10.1.2", "chai": "4.5.0", "chai-as-promised": "8.0.0", "dotenv": "16.4.5", "eslint": "8.57.0", "husky": "9.1.4", - "junit-report-builder": "3.2.1", + "junit-report-builder": "5.0.0", "lint-staged": "15.2.9", "mocha": "10.7.3", "mocha-multi-reporters": "1.5.1", @@ -98,7 +98,7 @@ "nodemon": "3.1.4", "semantic-release": "24.1.0", "sinon": "18.0.0", - "sinon-chai": "3.7.0", + "sinon-chai": "4.0.0", "typescript": "5.5.4", "yaml": "2.5.0" }, From 5e85e4e0fafd3c1485a112278bd181fa30e82f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominique=20J=C3=A4ggi?= Date: Tue, 20 Aug 2024 08:42:21 +0200 Subject: [PATCH 2/2] chore(deps): update external major --- .eslintrc.cjs | 2 +- package-lock.json | 242 +++++++++++----------------- package.json | 2 +- renovate.json5 | 6 - src/canonical/handler.js | 6 +- src/experimentation/handler.js | 2 +- src/support/utils.js | 4 +- test/audits/apex.test.js | 7 +- test/audits/backlinks.test.js | 7 +- test/audits/canonical.test.js | 7 +- test/audits/conversion.test.js | 5 +- test/audits/cwv.test.js | 5 +- test/audits/experimentation.test.js | 5 +- test/audits/lhs.test.js | 7 +- test/audits/notfound.test.js | 5 +- test/audits/sitemap.test.js | 7 +- test/common/audit.test.js | 7 +- test/index.test.js | 5 +- test/support/psi-client.test.js | 8 +- test/support/sqs.test.js | 7 +- test/support/utils.test.js | 7 +- test/utils/data-access.test.js | 5 +- test/utils/rum-utils.test.js | 5 +- 23 files changed, 143 insertions(+), 220 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 15ef5784..a58a4574 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -29,7 +29,7 @@ module.exports = { { files: ['*.test.js'], rules: { - 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'off', }, }, ], diff --git a/package-lock.json b/package-lock.json index 6b5989d7..2ed3c2df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,15 +40,15 @@ "@semantic-release/exec": "6.0.3", "@semantic-release/git": "10.0.1", "@semantic-release/npm": "12.0.1", - "@typescript-eslint/eslint-plugin": "7.18.0", - "@typescript-eslint/parser": "7.18.0", + "@typescript-eslint/eslint-plugin": "8.2.0", + "@typescript-eslint/parser": "8.2.0", "c8": "10.1.2", - "chai": "4.5.0", + "chai": "5.1.1", "chai-as-promised": "8.0.0", "dotenv": "16.4.5", "eslint": "8.57.0", "husky": "9.1.4", - "junit-report-builder": "3.2.1", + "junit-report-builder": "5.0.0", "lint-staged": "15.2.9", "mocha": "10.7.3", "mocha-multi-reporters": "1.5.1", @@ -57,7 +57,7 @@ "nodemon": "3.1.4", "semantic-release": "24.1.0", "sinon": "18.0.0", - "sinon-chai": "3.7.0", + "sinon-chai": "4.0.0", "typescript": "5.5.4", "yaml": "2.5.0" } @@ -21360,32 +21360,31 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.2.0.tgz", + "integrity": "sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.2.0", + "@typescript-eslint/type-utils": "8.2.0", + "@typescript-eslint/utils": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -21394,27 +21393,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.2.0.tgz", + "integrity": "sha512-j3Di+o0lHgPrb7FxL3fdEy6LJ/j2NE8u+AP/5cQ9SKb+JLH6V6UHDqJ+e0hXBkHP1wn1YDFjYCS9LBQsZDlDEg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.2.0", + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/typescript-estree": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -21423,17 +21421,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.2.0.tgz", + "integrity": "sha512-OFn80B38yD6WwpoHU2Tz/fTz7CgFqInllBoC3WP+/jLbTb4gGPTy9HBSTsbDWkMdN55XlVU0mMDYAtgvlUspGw==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -21441,27 +21438,23 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.2.0.tgz", + "integrity": "sha512-g1CfXGFMQdT5S+0PSO0fvGXUaiSkl73U1n9LTK5aRAFnPlJ8dLKkXr4AaLFvPedW8lVDoMgLLE3JN98ZZfsj0w==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.2.0", + "@typescript-eslint/utils": "8.2.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^8.56.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -21469,13 +21462,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.2.0.tgz", + "integrity": "sha512-6a9QSK396YqmiBKPkJtxsgZZZVjYQ6wQ/TlI0C65z7vInaETuC6HAHD98AGLC8DyIPqHytvNuS8bBVvNLKyqvQ==", "dev": true, - "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -21483,14 +21475,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.2.0.tgz", + "integrity": "sha512-kiG4EDUT4dImplOsbh47B1QnNmXSoUqOjWDvCJw/o8LgfD0yr7k2uy54D5Wm0j4t71Ge1NkynGhpWdS0dEIAUA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/visitor-keys": "8.2.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -21499,7 +21490,7 @@ "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -21516,7 +21507,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -21528,40 +21518,38 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.2.0.tgz", + "integrity": "sha512-O46eaYKDlV3TvAVDNcoDzd5N550ckSe8G4phko++OCSC1dYIb9LTc3HDGYdWqWIAT5qDUKphO6sd9RrpIJJPfg==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.2.0", + "@typescript-eslint/types": "8.2.0", + "@typescript-eslint/typescript-estree": "8.2.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.2.0.tgz", + "integrity": "sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.2.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -22031,7 +22019,6 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -22146,12 +22133,12 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/async": { @@ -22518,22 +22505,19 @@ "integrity": "sha512-dgh+YleemrT8u85QL11Z6tYhegAs3MMxsaWAq/oXeAmYJ7VxL3SI9TZtnfaEvNDMAPolj25FXIb3S+HCI4wQaQ==" }, "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, - "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chai-as-promised": { @@ -22549,26 +22533,6 @@ "chai": ">= 2.1.2 < 6" } }, - "node_modules/chai-as-promised/node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - } - }, - "node_modules/chai/node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/chalk": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", @@ -22606,15 +22570,12 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/cheerio": { @@ -23548,15 +23509,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/date-format": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.3.tgz", - "integrity": "sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -23612,13 +23564,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -25449,7 +25398,6 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, - "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -26751,18 +26699,17 @@ } }, "node_modules/junit-report-builder": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/junit-report-builder/-/junit-report-builder-3.2.1.tgz", - "integrity": "sha512-IMCp5XyDQ4YESDE4Za7im3buM0/7cMnRfe17k2X8B05FnUl9vqnaliX6cgOEmPIeWKfJrEe/gANRq/XgqttCqQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/junit-report-builder/-/junit-report-builder-5.0.0.tgz", + "integrity": "sha512-mWPsMQ84WXVQRgD8WuIPpxhyDKSGBAY5EBKqoJQBjdRltKHVzgbLhMGwzTria6SECiWjjqBjnlAN7qc0Cdiupw==", "dev": true, "dependencies": { - "date-format": "4.0.3", "lodash": "^4.17.21", "make-dir": "^3.1.0", "xmlbuilder": "^15.1.1" }, "engines": { - "node": ">=8" + "node": ">=16" } }, "node_modules/junit-report-builder/node_modules/make-dir": { @@ -27437,9 +27384,9 @@ } }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", "dev": true, "dependencies": { "get-func-name": "^2.0.1" @@ -31681,12 +31628,12 @@ } }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/perfect-scrollbar": { @@ -33434,12 +33381,12 @@ } }, "node_modules/sinon-chai": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", - "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-4.0.0.tgz", + "integrity": "sha512-cWqO7O2I4XfJDWyWElAQ9D/dtdh5Mo0RHndsfiiYyjWnlPzBJdIvjCVURO4EjyYaC3BjV+ISNXCfTXPXTEIEWA==", "dev": true, "peerDependencies": { - "chai": "^4.0.0", + "chai": "^5.0.0", "sinon": ">=4.0.0" } }, @@ -33460,7 +33407,6 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } diff --git a/package.json b/package.json index 82a445c5..23c2d65a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@typescript-eslint/eslint-plugin": "8.2.0", "@typescript-eslint/parser": "8.2.0", "c8": "10.1.2", - "chai": "4.5.0", + "chai": "5.1.1", "chai-as-promised": "8.0.0", "dotenv": "16.4.5", "eslint": "8.57.0", diff --git a/renovate.json5 b/renovate.json5 index d96b5720..d6710d62 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -10,12 +10,6 @@ ], "allowedVersions": ">=23.0" }, - { - "matchPackageNames": [ - "chai" - ], - "allowedVersions": "<5.0.0" - }, { "matchPackageNames": [ "eslint" diff --git a/src/canonical/handler.js b/src/canonical/handler.js index d3308bfa..8888c735 100644 --- a/src/canonical/handler.js +++ b/src/canonical/handler.js @@ -216,7 +216,7 @@ export async function validateCanonicalTag(url, log) { }); log.info(`Canonical URL ${canonicalUrl} does not reference itself`); } - } catch (error) { + } catch { checks.push({ check: CANONICAL_CHECKS.CANONICAL_URL_INVALID.check, success: false, @@ -273,7 +273,7 @@ export function validateCanonicalFormat(canonicalUrl, baseUrl, log) { try { base = new URL(baseUrl); - } catch (error) { + } catch { log.error(`Invalid URL: ${baseUrl}`); checks.push({ check: CANONICAL_CHECKS.URL_UNDEFINED.check, @@ -326,7 +326,7 @@ export function validateCanonicalFormat(canonicalUrl, baseUrl, log) { try { url = new URL(canonicalUrl); - } catch (error) { + } catch { log.error(`Invalid URL: ${canonicalUrl}`); checks.push({ check: CANONICAL_CHECKS.URL_UNDEFINED.check, diff --git a/src/experimentation/handler.js b/src/experimentation/handler.js index f43d6673..436aa8cd 100644 --- a/src/experimentation/handler.js +++ b/src/experimentation/handler.js @@ -35,7 +35,7 @@ export function hasNonWWWSubdomain(baseUrl) { try { const uri = new URI(baseUrl); return hasText(uri.domain()) && hasText(uri.subdomain()) && uri.subdomain() !== 'www'; - } catch (e) { + } catch { throw new Error(`Cannot parse baseURL: ${baseUrl}`); } } diff --git a/src/support/utils.js b/src/support/utils.js index d99b9703..56de2841 100644 --- a/src/support/utils.js +++ b/src/support/utils.js @@ -43,7 +43,7 @@ export function hasNonWWWSubdomain(baseUrl) { try { const uri = new URI(baseUrl); return hasText(uri.domain()) && hasText(uri.subdomain()) && uri.subdomain() !== 'www'; - } catch (e) { + } catch { throw new Error(`Cannot parse baseURL: ${baseUrl}`); } } @@ -75,7 +75,7 @@ export function extractDomainAndProtocol(inputUrl) { protocol: parsedUrl.protocol.slice(0, -1), domain: parsedUrl.hostname, }; - } catch (error) { + } catch { return null; } } diff --git a/test/audits/apex.test.js b/test/audits/apex.test.js index e3c22a10..9c8e58f9 100644 --- a/test/audits/apex.test.js +++ b/test/audits/apex.test.js @@ -11,7 +11,7 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; @@ -20,9 +20,8 @@ import { apexAuditRunner } from '../../src/apex/handler.js'; import { MockContextBuilder } from '../shared.js'; import { hasNonWWWSubdomain, toggleWWW } from '../../src/support/utils.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); const message = { type: 'apex', diff --git a/test/audits/backlinks.test.js b/test/audits/backlinks.test.js index 2c09f8d1..91f09d71 100644 --- a/test/audits/backlinks.test.js +++ b/test/audits/backlinks.test.js @@ -17,16 +17,15 @@ import { createSiteTopPage } from '@adobe/spacecat-shared-data-access/src/models import { createConfiguration } from '@adobe/spacecat-shared-data-access/src/models/configuration.js'; import { createOrganization } from '@adobe/spacecat-shared-data-access/src/models/organization.js'; -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import nock from 'nock'; import auditBrokenBacklinks from '../../src/backlinks/handler.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); describe('Backlinks Tests', function () { this.timeout(10000); diff --git a/test/audits/canonical.test.js b/test/audits/canonical.test.js index 1583d11c..d80f64a1 100644 --- a/test/audits/canonical.test.js +++ b/test/audits/canonical.test.js @@ -12,7 +12,7 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; @@ -22,9 +22,8 @@ import { validateCanonicalRecursively, canonicalAuditRunner, CANONICAL_CHECKS, } from '../../src/canonical/handler.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); describe('Canonical URL Tests', () => { let log; diff --git a/test/audits/conversion.test.js b/test/audits/conversion.test.js index 036e6e1f..d5ca889f 100644 --- a/test/audits/conversion.test.js +++ b/test/audits/conversion.test.js @@ -11,15 +11,14 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import nock from 'nock'; import { conversionAuditRunner } from '../../src/conversion/handler.js'; import { rumDashboardData, rumSourcesData, expectedConversionData } from '../fixtures/conversion-data.js'; -chai.use(sinonChai); -const { expect } = chai; +use(sinonChai); const DOMAIN_REQUEST_DEFAULT_PARAMS = { interval: 7, diff --git a/test/audits/cwv.test.js b/test/audits/cwv.test.js index bb3abbd2..ae5cf8e3 100644 --- a/test/audits/cwv.test.js +++ b/test/audits/cwv.test.js @@ -12,7 +12,7 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import { Request } from '@adobe/fetch'; @@ -22,8 +22,7 @@ import { main } from '../../src/index.js'; import { getRUMUrl } from '../../src/support/utils.js'; import { expectedAuditResult, rumData } from '../fixtures/rum-data.js'; -chai.use(sinonChai); -const { expect } = chai; +use(sinonChai); const sandbox = sinon.createSandbox(); const DOMAIN_REQUEST_DEFAULT_PARAMS = { diff --git a/test/audits/experimentation.test.js b/test/audits/experimentation.test.js index eceb6cf7..03835683 100644 --- a/test/audits/experimentation.test.js +++ b/test/audits/experimentation.test.js @@ -11,7 +11,7 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import nock from 'nock'; @@ -24,8 +24,7 @@ import { rumDataEmpty, } from '../fixtures/experimentation-data.js'; -chai.use(sinonChai); -const { expect } = chai; +use(sinonChai); const DOMAIN_REQUEST_DEFAULT_PARAMS = { interval: 7, diff --git a/test/audits/lhs.test.js b/test/audits/lhs.test.js index 608cf0b5..aaabdd05 100644 --- a/test/audits/lhs.test.js +++ b/test/audits/lhs.test.js @@ -12,7 +12,7 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; @@ -27,9 +27,8 @@ import createLHSAuditRunner, { } from '../../src/lhs/lib.js'; import { MockContextBuilder } from '../shared.js'; -const { expect } = chai; -chai.use(sinonChai); -chai.use(chaiAsPromised); +use(sinonChai); +use(chaiAsPromised); const message = { type: 'lhs-mobile', diff --git a/test/audits/notfound.test.js b/test/audits/notfound.test.js index 0ce78e93..31099f64 100644 --- a/test/audits/notfound.test.js +++ b/test/audits/notfound.test.js @@ -12,7 +12,7 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import nock from 'nock'; @@ -20,8 +20,7 @@ import { audit404Runner } from '../../src/notfound/handler.js'; import { notFoundData } from '../fixtures/notfounddata.js'; import { MockContextBuilder } from '../shared.js'; -chai.use(sinonChai); -const { expect } = chai; +use(sinonChai); describe('404 Tests', () => { const url = 'https://abc.com'; diff --git a/test/audits/sitemap.test.js b/test/audits/sitemap.test.js index aa84d4c1..7b9426b5 100644 --- a/test/audits/sitemap.test.js +++ b/test/audits/sitemap.test.js @@ -11,7 +11,7 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import nock from 'nock'; @@ -26,9 +26,8 @@ import { import { extractDomainAndProtocol } from '../../src/support/utils.js'; import { MockContextBuilder } from '../shared.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); const sandbox = sinon.createSandbox(); describe('Sitemap Audit', () => { diff --git a/test/common/audit.test.js b/test/common/audit.test.js index 461b93cc..a3078ab4 100644 --- a/test/common/audit.test.js +++ b/test/common/audit.test.js @@ -11,7 +11,7 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; @@ -30,9 +30,8 @@ import { AuditBuilder } from '../../src/common/audit-builder.js'; import { MockContextBuilder } from '../shared.js'; import { getUrlWithoutPath } from '../../src/support/utils.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); const baseURL = 'https://space.cat'; const message = { diff --git a/test/index.test.js b/test/index.test.js index cc5b2841..6f3769dd 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -12,14 +12,13 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import { Request } from '@adobe/fetch'; import { main } from '../src/index.js'; -chai.use(sinonChai); -const { expect } = chai; +use(sinonChai); const sandbox = sinon.createSandbox(); diff --git a/test/support/psi-client.test.js b/test/support/psi-client.test.js index 242ec2cf..68c56832 100644 --- a/test/support/psi-client.test.js +++ b/test/support/psi-client.test.js @@ -12,16 +12,14 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import nock from 'nock'; import sinon from 'sinon'; import PSIClient from '../../src/support/psi-client.js'; -chai.use(chaiAsPromised); - -const { expect } = chai; +use(chaiAsPromised); describe('PSIClient', () => { let client; @@ -104,7 +102,7 @@ describe('PSIClient', () => { try { await client.performPSICheck('testsite.com', 'mobile'); expect.fail('Should have thrown an error'); - } catch (e) { + } catch { expect(logMock.error.called).to.be.true; } }); diff --git a/test/support/sqs.test.js b/test/support/sqs.test.js index 1dd5444b..c9b31504 100644 --- a/test/support/sqs.test.js +++ b/test/support/sqs.test.js @@ -14,16 +14,15 @@ import wrap from '@adobe/helix-shared-wrap'; import sinon from 'sinon'; -import chai from 'chai'; +import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import nock from 'nock'; import crypto from 'crypto'; import sqsWrapper from '../../src/support/sqs.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); const sandbox = sinon.createSandbox(); diff --git a/test/support/utils.test.js b/test/support/utils.test.js index 0d421d4b..bdcef654 100644 --- a/test/support/utils.test.js +++ b/test/support/utils.test.js @@ -11,7 +11,7 @@ */ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; @@ -21,9 +21,8 @@ import { getUrlWithoutPath, } from '../../src/support/utils.js'; -chai.use(sinonChai); -chai.use(chaiAsPromised); -const { expect } = chai; +use(sinonChai); +use(chaiAsPromised); describe('getUrlWithoutPath', () => { it('returns the URL without the path from a URL with a path', () => { diff --git a/test/utils/data-access.test.js b/test/utils/data-access.test.js index cd1db25c..50033d37 100644 --- a/test/utils/data-access.test.js +++ b/test/utils/data-access.test.js @@ -12,13 +12,12 @@ /* eslint-env mocha */ -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import { retrieveSiteBySiteId } from '../../src/utils/data-access.js'; -chai.use(chaiAsPromised); -const { expect } = chai; +use(chaiAsPromised); describe('retrieveSiteBySiteId', () => { let mockDataAccess; diff --git a/test/utils/rum-utils.test.js b/test/utils/rum-utils.test.js index 2ffe3d8b..58638183 100644 --- a/test/utils/rum-utils.test.js +++ b/test/utils/rum-utils.test.js @@ -13,12 +13,11 @@ /* eslint-env mocha */ import nock from 'nock'; -import chai from 'chai'; +import { expect, use } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { getRUMDomainkey } from '../../src/support/utils.js'; -chai.use(chaiAsPromised); -const { expect } = chai; +use(chaiAsPromised); describe('rum utils', () => { let context;