diff --git a/CHANGELOG.md b/CHANGELOG.md index 861dfd69..e4a62a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,34 @@ > - :house: [Internal] > - :nail_care: [Polish] +## 4.2.39 + +#### :house: Internal + +- Chai.js switched to ESM from version 5.0.0, which led to problems with tests inside browser. + To solve the problem, we abandoned node_modules version and switched to jsdelivr+esm + We are not removing the dependency yet, see `./test/tests/chai-loader.js` + +- Update dependencies + +```plain + @eslint/compat ^1.2.0 → ^1.2.2 + @eslint/js ^9.12.0 → ^9.14.0 + @playwright/test ^1.48.0 → ^1.48.2 + @types/karma ^6.3.8 → ^6.3.9 + @types/node ^20.16.11 → ^22.8.7 + @typescript-eslint/eslint-plugin ^8.8.1 → ^8.12.2 + @typescript-eslint/parser ^8.8.1 → ^8.12.2 + compression ^1.7.4 → ^1.7.5 + core-js ^3.38.1 → ^3.39.0 + eslint ^9.12.0 → ^9.14.0 + mini-css-extract-plugin ^2.9.1 → ^2.9.2 + mocha ^10.7.3 → ^10.8.2 + tslib ^2.7.0 → ^2.8.1 + tsx ^4.19.1 → ^4.19.2 + webpack 5.95.0 → 5.96.1 +``` + ## 4.2.38 ### :bug: Bug Fix diff --git a/package-lock.json b/package-lock.json index 09c39119..4185f06e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,33 +12,33 @@ "autobind-decorator": "^2.4.0" }, "devDependencies": { - "@eslint/compat": "^1.2.0", + "@eslint/compat": "^1.2.2", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "^9.12.0", - "@playwright/test": "^1.48.0", + "@eslint/js": "^9.14.0", + "@playwright/test": "^1.48.2", "@types/ace": "^0.0.52", "@types/fs-extra": "^11.0.4", - "@types/karma": "^6.3.8", + "@types/karma": "^6.3.9", "@types/mime-types": "^2.1.4", "@types/mocha": "^10.0.9", - "@types/node": "^20.16.11", + "@types/node": "^22.8.7", "@types/postcss-css-variables": "^0.18.3", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@typescript-eslint/eslint-plugin": "^8.12.2", + "@typescript-eslint/parser": "^8.12.2", "autoprefixer": "^10.4.20", "axios": "^1.7.7", "chai": "^4.5.0", "classlist-polyfill": "^1.2.0", - "compression": "^1.7.4", - "core-js": "^3.38.1", + "compression": "^1.7.5", + "core-js": "^3.39.0", "cross-env": "^7.0.3", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "^7.0.0", "cssnano-preset-advanced": "^7.0.6", "dotenv": "^16.4.5", "es6-promise": "^4.2.8", - "eslint": "^9.12.0", + "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.31.0", @@ -58,8 +58,8 @@ "less-loader": "^12.2.0", "merge-stream": "^2.0.0", "mime-types": "^2.1.35", - "mini-css-extract-plugin": "^2.9.1", - "mocha": "^10.7.3", + "mini-css-extract-plugin": "^2.9.2", + "mocha": "^10.8.2", "node-jq": "^6.0.1", "open": "^10.1.0", "postcss": ">=8.4.47", @@ -78,10 +78,10 @@ "terser-webpack-plugin": "^5.3.10", "ts-loader": "^9.5.1", "ts-node": "^10.9.2", - "tslib": "^2.7.0", - "tsx": "^4.19.1", + "tslib": "^2.8.1", + "tsx": "^4.19.2", "typescript": "^5.6.3", - "webpack": "5.95.0", + "webpack": "5.96.1", "webpack-cli": "^5.1.4", "webpack-dev-middleware": "^7.4.2", "webpack-dev-server": "^5.1.0", @@ -777,9 +777,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -787,9 +787,9 @@ } }, "node_modules/@eslint/compat": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.0.tgz", - "integrity": "sha512-CkPWddN7J9JPrQedEr2X7AjK9y1jaMJtxZ4A/+jTMFA2+n5BWhcKHW/EbJyARqg2zzQfgtWUtVmG3hrG6+nGpg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.2.2.tgz", + "integrity": "sha512-jhgiIrsw+tRfcBQ4BFl2C3vCrIUw2trCY0cnDvGZpwTtKCEDmZhAtMfrEUP/KpnwM6PrO0T+Ltm+ccW74olG3Q==", "dev": true, "license": "Apache-2.0", "engines": { @@ -820,9 +820,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -867,9 +867,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.14.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz", + "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==", "dev": true, "license": "MIT", "engines": { @@ -900,9 +900,9 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -910,19 +910,33 @@ } }, "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanfs/core": "^0.19.0", + "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -938,9 +952,9 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.0.tgz", + "integrity": "sha512-xnRgu9DxZbkWak/te3fcytNyp8MTbuiZIaueg2rgEvBuN55n04nwLYLU9TX/VVlusc9L2ZNXi99nUFNkHXtr5g==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1248,13 +1262,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", - "integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.2.tgz", + "integrity": "sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.48.0" + "playwright": "1.48.2" }, "bin": { "playwright": "cli.js" @@ -1388,6 +1402,28 @@ "@types/node": "*" } }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1514,9 +1550,9 @@ } }, "node_modules/@types/karma": { - "version": "6.3.8", - "resolved": "https://registry.npmjs.org/@types/karma/-/karma-6.3.8.tgz", - "integrity": "sha512-+QGoOPhb1f6Oli8pG+hxdnGDzVhIrpsHaFSJ4UJg15Xj+QBtluKELkJY+L4Li532HmT3l5K5o1FoUZHRQeOOaQ==", + "version": "6.3.9", + "resolved": "https://registry.npmjs.org/@types/karma/-/karma-6.3.9.tgz", + "integrity": "sha512-sjE/MHnoAZAQYAKRXAbjTOiBKyGGErEM725bruRcmDdMa2vp1bjWPhApI7/i564PTyHlzc3vIGXLL6TFIpAxFg==", "dev": true, "license": "MIT", "dependencies": { @@ -1546,13 +1582,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.16.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", - "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", + "version": "22.8.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.7.tgz", + "integrity": "sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@types/node-forge": { @@ -1667,17 +1703,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz", - "integrity": "sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.2.tgz", + "integrity": "sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/type-utils": "8.8.1", - "@typescript-eslint/utils": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/type-utils": "8.12.2", + "@typescript-eslint/utils": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1701,16 +1737,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", - "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.2.tgz", + "integrity": "sha512-MrvlXNfGPLH3Z+r7Tk+Z5moZAc0dzdVjTgUgwsdGweH7lydysQsnSww3nAmsq8blFuRD5VRlAr9YdEFw3e6PBw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/typescript-estree": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "debug": "^4.3.4" }, "engines": { @@ -1730,14 +1766,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", - "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.2.tgz", + "integrity": "sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1" + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1748,14 +1784,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz", - "integrity": "sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.2.tgz", + "integrity": "sha512-bwuU4TAogPI+1q/IJSKuD4shBLc/d2vGcRT588q+jzayQyjVK2X6v/fbR4InY2U2sgf8MEvVCqEWUzYzgBNcGQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/utils": "8.8.1", + "@typescript-eslint/typescript-estree": "8.12.2", + "@typescript-eslint/utils": "8.12.2", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1773,9 +1809,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", - "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.2.tgz", + "integrity": "sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==", "dev": true, "license": "MIT", "engines": { @@ -1787,14 +1823,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", - "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.2.tgz", + "integrity": "sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/visitor-keys": "8.12.2", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1842,16 +1878,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", - "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.2.tgz", + "integrity": "sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1" + "@typescript-eslint/scope-manager": "8.12.2", + "@typescript-eslint/types": "8.12.2", + "@typescript-eslint/typescript-estree": "8.12.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1865,13 +1901,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", - "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "version": "8.12.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.2.tgz", + "integrity": "sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/types": "8.12.2", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -2119,9 +2155,9 @@ } }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -2131,16 +2167,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -2625,16 +2651,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/body-parser/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2758,9 +2774,9 @@ } }, "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "license": "MIT", "engines": { @@ -3151,18 +3167,18 @@ } }, "node_modules/compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz", + "integrity": "sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q==", "dev": true, "license": "MIT", "dependencies": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", + "bytes": "3.1.2", + "compressible": "~2.0.18", "debug": "2.6.9", + "negotiator": "~0.6.4", "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", + "safe-buffer": "5.2.1", "vary": "~1.1.2" }, "engines": { @@ -3186,6 +3202,37 @@ "dev": true, "license": "MIT" }, + "node_modules/compression/node_modules/negotiator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3311,9 +3358,9 @@ } }, "node_modules/core-js": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.1.tgz", - "integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==", + "version": "3.39.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.39.0.tgz", + "integrity": "sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -4510,22 +4557,22 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.14.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz", + "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", + "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.14.0", "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", + "@humanwhocodes/retry": "^0.4.0", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", @@ -4533,9 +4580,9 @@ "cross-spawn": "^7.0.2", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -4797,9 +4844,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4856,9 +4903,9 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -4869,15 +4916,15 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4887,9 +4934,9 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -7565,9 +7612,9 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.1.tgz", - "integrity": "sha512-+Vyi+GCCOHnrJ2VPS+6aPoXN2k2jgUzDRhTFLjjTBn23qyXJXkjUWQgTL+mXpF5/A8ixLdCc6kWsoeOjKGejKQ==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.2.tgz", + "integrity": "sha512-GJuACcS//jtq4kCtd5ii/M0SZf7OZRH+BxdqXZHaJfb8TJiVl+NgQRPwiYt2EuqeSkNydn/7vP+bcE27C5mb9w==", "dev": true, "license": "MIT", "dependencies": { @@ -7756,9 +7803,9 @@ } }, "node_modules/mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "license": "MIT", "dependencies": { @@ -8610,13 +8657,13 @@ } }, "node_modules/playwright": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", - "integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.2.tgz", + "integrity": "sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.48.0" + "playwright-core": "1.48.2" }, "bin": { "playwright": "cli.js" @@ -8629,9 +8676,9 @@ } }, "node_modules/playwright-core": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", - "integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", + "version": "1.48.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.2.tgz", + "integrity": "sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -9575,16 +9622,6 @@ "node": ">= 0.8" } }, - "node_modules/raw-body/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/raw-loader": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", @@ -11951,16 +11988,16 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, "license": "0BSD" }, "node_modules/tsx": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.1.tgz", - "integrity": "sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", + "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", "dev": true, "license": "MIT", "dependencies": { @@ -12334,19 +12371,19 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", diff --git a/package.json b/package.json index 20f5eb2c..cd97c9a9 100644 --- a/package.json +++ b/package.json @@ -50,33 +50,33 @@ "autobind-decorator": "^2.4.0" }, "devDependencies": { - "@eslint/compat": "^1.2.0", + "@eslint/compat": "^1.2.2", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "^9.12.0", - "@playwright/test": "^1.48.0", + "@eslint/js": "^9.14.0", + "@playwright/test": "^1.48.2", "@types/ace": "^0.0.52", "@types/fs-extra": "^11.0.4", - "@types/karma": "^6.3.8", + "@types/karma": "^6.3.9", "@types/mime-types": "^2.1.4", "@types/mocha": "^10.0.9", - "@types/node": "^20.16.11", + "@types/node": "^22.8.7", "@types/postcss-css-variables": "^0.18.3", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@typescript-eslint/eslint-plugin": "^8.12.2", + "@typescript-eslint/parser": "^8.12.2", "autoprefixer": "^10.4.20", "axios": "^1.7.7", "chai": "^4.5.0", "classlist-polyfill": "^1.2.0", - "compression": "^1.7.4", - "core-js": "^3.38.1", + "compression": "^1.7.5", + "core-js": "^3.39.0", "cross-env": "^7.0.3", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "^7.0.0", "cssnano-preset-advanced": "^7.0.6", "dotenv": "^16.4.5", "es6-promise": "^4.2.8", - "eslint": "^9.12.0", + "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.31.0", @@ -87,7 +87,6 @@ "glob": "^11.0.0", "globals": "^15.11.0", "karma": "^6.4.4", - "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.2.0", "karma-firefox-launcher": "^2.1.3", "karma-mocha": "^2.0.1", @@ -96,8 +95,8 @@ "less-loader": "^12.2.0", "merge-stream": "^2.0.0", "mime-types": "^2.1.35", - "mini-css-extract-plugin": "^2.9.1", - "mocha": "^10.7.3", + "mini-css-extract-plugin": "^2.9.2", + "mocha": "^10.8.2", "node-jq": "^6.0.1", "open": "^10.1.0", "postcss": ">=8.4.47", @@ -116,10 +115,10 @@ "terser-webpack-plugin": "^5.3.10", "ts-loader": "^9.5.1", "ts-node": "^10.9.2", - "tslib": "^2.7.0", - "tsx": "^4.19.1", + "tslib": "^2.8.1", + "tsx": "^4.19.2", "typescript": "^5.6.3", - "webpack": "5.95.0", + "webpack": "5.96.1", "webpack-cli": "^5.1.4", "webpack-dev-middleware": "^7.4.2", "webpack-dev-server": "^5.1.0", diff --git a/src/modules/image-editor/image-editor.test.js b/src/modules/image-editor/image-editor.test.js index e8872efe..0cb60117 100644 --- a/src/modules/image-editor/image-editor.test.js +++ b/src/modules/image-editor/image-editor.test.js @@ -13,6 +13,8 @@ describe('Image editor', () => { describe('Crop mode', () => { describe('Enable ratio', () => { it('Should deny crop image without ratio', async () => { + unmockPromise(); + const area = appendTestArea(); const editor = Jodit.make(area, { history: { @@ -120,6 +122,8 @@ describe('Image editor', () => { describe('Disable ratio', () => { it('Should allow crop image without ratio', async () => { + unmockPromise(); + const area = appendTestArea(); const editor = Jodit.make(area, { diff --git a/src/modules/toolbar/toolbar.test.js b/src/modules/toolbar/toolbar.test.js index 80bd4639..e33d6c86 100644 --- a/src/modules/toolbar/toolbar.test.js +++ b/src/modules/toolbar/toolbar.test.js @@ -1349,7 +1349,7 @@ describe('Toolbar', () => { }); describe('Check Redo Undo functionality', function () { - it('Should change disable in icon then then can not be executed', function () { + it('Should change disable in icon then can not be executed', function () { const area = appendTestArea(); area.value = 'top'; const editor = new Jodit(area, { diff --git a/test/bootstrap.js b/test/bootstrap.js index 98116b7f..4cc223fd 100644 --- a/test/bootstrap.js +++ b/test/bootstrap.js @@ -10,21 +10,24 @@ const box = document.createElement('div'); document.body.appendChild(box); -if (typeof chai === 'undefined') { - console.error('Please include chai.js'); -} +typeof before === 'function' && + before(async () => { + if (typeof waitChai !== 'undefined') { + window.expect = await waitChai; + } -const expect = typeof chai !== 'undefined' ? chai.expect : function () {}, - stuff = []; + if (typeof chai !== 'undefined') { + window.expect = chai.expect; + } -const stringify = Jodit.ns.Helpers.stringify; + if (typeof expect === 'undefined') { + console.error('Please include chai.js'); + } + }); -typeof window.chai !== 'undefined' && - (function () { - chai.config.truncateThreshold = 0; - chai.config.includeStack = true; - // chai.config.showDiff = true; - })(); +const staff = []; + +const stringify = Jodit.ns.Helpers.stringify; typeof window.mocha !== 'undefined' && mocha.timeout(15000); Jodit.constants.SET_TEST(); @@ -226,7 +229,7 @@ const defaultPermissions = { }; function mockAjax() { - if (typeof window.chai !== 'undefined') { + if (typeof window.expect !== 'undefined') { let temp = {}; Jodit.modules.Ajax.prototype.send = function () { const ajax = this; @@ -463,24 +466,27 @@ function unmockAjax() { Jodit.modules.Ajax.prototype.send = oldAjaxSender; } -if (typeof window.chai !== 'undefined') { - mockPromise(); - mockAjax(); - window.FormData = function () { - this.data = {}; - this.names = {}; - this.append = function (key, value, name) { - this.data[key] = value; - this.names[key] = name; - }; - this.get = function (key) { - return this.data[key]; - }; - this.getName = function (key) { - return this.names[key]; - }; - }; -} +typeof before === 'function' && + before(() => { + if (typeof window.expect !== 'undefined') { + mockPromise(); + mockAjax(); + window.FormData = function () { + this.data = {}; + this.names = {}; + this.append = function (key, value, name) { + this.data[key] = value; + this.names[key] = name; + }; + this.get = function (key) { + return this.data[key]; + }; + this.getName = function (key) { + return this.names[key]; + }; + }; + } + }); const i18nkeys = new Set(); const excludeI18nKeys = new Set([ @@ -611,11 +617,11 @@ function removeStuff() { Jodit.instances[key].destruct(); }); - stuff.forEach(function (elm) { + staff.forEach(function (elm) { elm && elm.parentNode && elm.parentNode.removeChild(elm); }); - stuff.length = 0; + staff.length = 0; Array.from( document.querySelectorAll( @@ -654,7 +660,7 @@ function appendTestArea(id, noput) { textarea.setAttribute('id', id || 'editor_' + new Date().getTime()); box.appendChild(textarea); - !noput && stuff.push(textarea); + !noput && staff.push(textarea); return textarea; } @@ -692,7 +698,7 @@ function appendTestDiv(id, noput) { const textarea = document.createElement('div'); textarea.setAttribute('id', id || 'editor_' + new Date().getTime()); box.appendChild(textarea); - !noput && stuff.push(textarea); + !noput && staff.push(textarea); return textarea; } @@ -884,7 +890,7 @@ function fillBoxBr(count) { for (let i = 0; i < 100; i += 1) { const br = document.createElement('br'); getBox().appendChild(br); - stuff.push(br); + staff.push(br); } } @@ -1241,7 +1247,7 @@ function createPoint(x, y, color, fixed = false) { div.style.top = parseInt(y, 10) + 'px'; document.body.appendChild(div); - stuff.push(div); + staff.push(div); } function offset(el) { @@ -1399,24 +1405,27 @@ function FileXLS() { }; } -if (typeof window.chai !== 'undefined') { - window.FileReader = function () { - const self = this; - self.result = null; - /** - * - * @param {FileImage} file - */ - self.readAsDataURL = function (file) { - self.result = file.dataURI; - self.onloadend && self.onloadend(); - }; - }; -} +typeof before === 'function' && + before(() => { + if (typeof window.expect !== 'undefined') { + window.FileReader = function () { + const self = this; + self.result = null; + /** + * + * @param {FileImage} file + */ + self.readAsDataURL = function (file) { + self.result = file.dataURI; + self.onloadend && self.onloadend(); + }; + }; + } -Object.defineProperty(navigator, 'userAgent', { - value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 YaBrowser/18.9.0.3363 Yowser/2.5 Safari/537.36' -}); + Object.defineProperty(navigator, 'userAgent', { + value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 YaBrowser/18.9.0.3363 Yowser/2.5 Safari/537.36' + }); + }); /** * diff --git a/test/test.html b/test/test.html index b0286ef9..87253cd7 100644 --- a/test/test.html +++ b/test/test.html @@ -10,37 +10,13 @@ Jodit Tests - + + + + + + +
@@ -50,6 +26,7 @@ ui: 'bdd', // parallel: true, globals: [ + 'expect', 'html_beautify', 'js_beautify', 'mochaTestName', diff --git a/test/tests/chai-loader.js b/test/tests/chai-loader.js new file mode 100644 index 00000000..28ee90a7 --- /dev/null +++ b/test/tests/chai-loader.js @@ -0,0 +1,8 @@ +let resolveChai; +window.waitChai = new Promise(resolve => { + resolveChai = resolve; +}); + +import('https://cdn.jsdelivr.net/npm/chai@5.1.2/+esm').then(({ expect }) => + resolveChai(expect) +); diff --git a/tools/dev-server/index.ts b/tools/dev-server/index.ts index 79d65dbc..afb3664f 100644 --- a/tools/dev-server/index.ts +++ b/tools/dev-server/index.ts @@ -42,15 +42,6 @@ export const devServer = ({ port, dirname }: Variables): Configuration => ({ watch: false } ], - setupMiddlewares: (middlewares, devServer): Middleware[] => { - if (!devServer) { - throw new Error('webpack-dev-server is not defined'); - } - - // devServer.app.get('/test', express.static(dirname + '/test')); - - return middlewares; - }, hot: true, host: 'localhost', port diff --git a/tools/karma.conf.ts b/tools/karma.conf.ts index cbc53704..f0a8581e 100644 --- a/tools/karma.conf.ts +++ b/tools/karma.conf.ts @@ -59,6 +59,31 @@ if ( throw new Error('Invalid minified build option'); } +const FirefoxHeadless = { + base: 'Firefox', + flags: ['-width', '1440', '-height', '900', '-headless'] +}; + +const chrome_debug = { + base: 'Chrome', + flags: [ + '--window-size=1440,900', + '--disable-gpu', + '--disable-extensions', + '--disable-translate' + ] +}; + +const chrome_headless = { + base: 'ChromeHeadless', + flags: [ + '--window-size=1440,900', + '--disable-gpu', + '--disable-extensions', + '--disable-translate' + ] +}; + function findFiles(dir: string): string[] { return fs .readdirSync(dir, { withFileTypes: true }) @@ -79,12 +104,15 @@ console.info('Build files: ', buildFiles); module.exports = function (cnf: Config): void { cnf.set({ + retryLimit: 5, // default 2 + basePath: argv.cwd, - frameworks: ['mocha', 'chai'], + frameworks: ['mocha'], mime: { 'text/css': ['css'], 'text/x-typescript': ['ts', 'tsx'], + 'text/javascript': ['js'], 'image/jpeg': ['jpg'] }, @@ -104,6 +132,14 @@ module.exports = function (cnf: Config): void { './test/tests/browser-module.js', './node_modules/synchronous-promise/index.js', + // Chai 5.x doesn't support browser, but inside Chrome this solution doesn't work + // Some tests could not wait for the promise to resolve eg.: Jodit FileBrowser Tests >>> Click on preview > Should open preview dialog + { + pattern: './test/tests/chai-loader.js', + type: 'module' + }, + // './node_modules/chai/chai.js', + ...buildFiles, ...Array.from( @@ -134,33 +170,14 @@ module.exports = function (cnf: Config): void { 'chrome_debug', 'chrome_headless', 'FirefoxHeadless', + 'Chrome', 'Firefox' ], customLaunchers: { - FirefoxHeadless: { - base: 'Firefox', - flags: ['-width', '1440', '-height', '900', '-headless'] - }, - - chrome_debug: { - base: 'Chrome', - flags: [ - '--window-size=1440,900', - '--disable-gpu', - '--disable-extensions', - '--disable-translate' - ] - }, - - chrome_headless: { - base: 'ChromeHeadless', - flags: [ - '--window-size=1440,900', - '--disable-gpu', - '--disable-extensions', - '--disable-translate' - ] - } + chrome_debug, + chrome_headless, + Chrome: chrome_headless, + FirefoxHeadless }, autoWatch: true, @@ -171,7 +188,6 @@ module.exports = function (cnf: Config): void { 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-mocha', - 'karma-chai', 'karma-sourcemap-loader' ],