From 6b3dac803d2f341be40efb8b1c8f4fd851eb1afc Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 13 Oct 2023 11:13:03 +0200 Subject: [PATCH] Merge pull request #15006 from overleaf/mj-bad-karma [web] Remove karma tests and config GitOrigin-RevId: a157f46d1ecf93fcbc99713a1c3aa11f82e5a619 --- package-lock.json | 998 ------------------ patches/finalhandler+1.1.2.patch | 13 - services/web/.eslintrc | 9 - services/web/Makefile | 29 +- services/web/docker-compose.ci.yml | 14 - services/web/docker-compose.yml | 13 - services/web/karma.conf.js | 65 -- services/web/package.json | 11 +- .../spell-check/SpellCheckManagerTests.js | 308 ------ .../ide/history/HistoryV2ManagerTests.js | 649 ------------ services/web/test/karma/import_tests.js | 45 - services/web/test/karma/support/fixture.js | 18 - services/web/webpack.config.test.js | 16 - 13 files changed, 7 insertions(+), 2181 deletions(-) delete mode 100644 patches/finalhandler+1.1.2.patch delete mode 100644 services/web/karma.conf.js delete mode 100644 services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js delete mode 100644 services/web/test/karma/ide/history/HistoryV2ManagerTests.js delete mode 100644 services/web/test/karma/import_tests.js delete mode 100644 services/web/test/karma/support/fixture.js delete mode 100644 services/web/webpack.config.test.js diff --git a/package-lock.json b/package-lock.json index ae5c45cbd7..13853fe436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3178,15 +3178,6 @@ "w3c-keyname": "^2.2.4" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/@contentful/axios": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/@contentful/axios/-/axios-0.18.0.tgz", @@ -9031,12 +9022,6 @@ "node": ">=14.0.0" } }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", - "dev": true - }, "node_modules/@storybook/addon-a11y": { "version": "7.0.17", "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-7.0.17.tgz", @@ -17140,12 +17125,6 @@ "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz", "integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==" }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, "node_modules/@types/cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", @@ -17163,15 +17142,6 @@ "@types/node": "*" } }, - "node_modules/@types/cors": { - "version": "2.8.13", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", - "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/cross-spawn": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.2.tgz", @@ -21483,21 +21453,6 @@ "json5": "lib/cli.js" } }, - "node_modules/connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/connect-history-api-fallback": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", @@ -21515,21 +21470,6 @@ "node": ">=12" } }, - "node_modules/connect/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/connect/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -22962,12 +22902,6 @@ "integrity": "sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==", "dev": true }, - "node_modules/custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true - }, "node_modules/cypress": { "version": "13.3.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", @@ -23333,15 +23267,6 @@ "url": "https://opencollective.com/date-fns" } }, - "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/dateformat": { "version": "1.0.4-1.2.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.4-1.2.3.tgz", @@ -23745,12 +23670,6 @@ "wrappy": "1" } }, - "node_modules/di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true - }, "node_modules/dicer": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", @@ -23926,18 +23845,6 @@ "@babel/runtime": "^7.1.2" } }, - "node_modules/dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", - "dev": true, - "dependencies": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" - } - }, "node_modules/dom-serializer": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", @@ -24332,75 +24239,6 @@ "objectorarray": "^1.0.5" } }, - "node_modules/engine.io": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.2.tgz", - "integrity": "sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA==", - "dev": true, - "dependencies": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/engine.io-parser": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", - "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io/node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true, - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, - "node_modules/engine.io/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/engine.io/node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/enhanced-resolve": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", @@ -26640,39 +26478,6 @@ "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/find-babel-config": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.0.0.tgz", @@ -29972,18 +29777,6 @@ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, - "node_modules/isbinaryfile": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz", - "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==", - "dev": true, - "engines": { - "node": ">= 8.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/gjtorikian/" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -31007,206 +30800,6 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" }, - "node_modules/karma": { - "version": "6.3.17", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.17.tgz", - "integrity": "sha512-2TfjHwrRExC8yHoWlPBULyaLwAFmXmxQrcuFImt/JsAsSZu1uOWTZ1ZsWjqQtWpHLiatJOHL5jFjXSJIgCd01g==", - "dev": true, - "dependencies": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.2.0", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" - }, - "bin": { - "karma": "bin/karma" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/karma-chai-sinon": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/karma-chai-sinon/-/karma-chai-sinon-0.1.5.tgz", - "integrity": "sha1-XDksqVJHgYlR1rV5AvAsNugDdTo=", - "dev": true, - "engines": { - "node": ">=0.8" - }, - "peerDependencies": { - "chai": "*", - "karma": ">=0.6", - "sinon": "*", - "sinon-chai": "*" - } - }, - "node_modules/karma-chrome-launcher": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", - "dev": true, - "dependencies": { - "which": "^1.2.1" - } - }, - "node_modules/karma-chrome-launcher/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.3" - } - }, - "node_modules/karma-mocha-reporter": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz", - "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", - "dev": true, - "dependencies": { - "chalk": "^2.1.0", - "log-symbols": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "peerDependencies": { - "karma": ">=0.13" - } - }, - "node_modules/karma-mocha-reporter/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/karma-mocha-reporter/node_modules/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "dependencies": { - "chalk": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/karma-mocha-reporter/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/karma-requirejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-requirejs/-/karma-requirejs-1.1.0.tgz", - "integrity": "sha1-/driy4fX68FvsCIok1ZNf+5Xh5g=", - "dev": true, - "peerDependencies": { - "karma": ">=0.9", - "requirejs": "^2.1.0" - } - }, - "node_modules/karma/node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true, - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, - "node_modules/karma/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/karma/node_modules/socket.io": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.2.tgz", - "integrity": "sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw==", - "dev": true, - "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "cors": "~2.8.5", - "debug": "~4.3.2", - "engine.io": "~6.5.2", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.4" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/karma/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/keycode": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.1.tgz", @@ -32171,22 +31764,6 @@ "node": ">=8" } }, - "node_modules/log4js": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.1.tgz", - "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", - "dev": true, - "dependencies": { - "date-format": "^4.0.3", - "debug": "^4.3.3", - "flatted": "^3.2.4", - "rfdc": "^1.3.0", - "streamroller": "^3.0.2" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -36083,15 +35660,6 @@ "async-limiter": "~1.0.0" } }, - "node_modules/qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", - "dev": true, - "engines": { - "node": ">=0.9" - } - }, "node_modules/qrcode": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.0.tgz", @@ -38659,36 +38227,6 @@ "redis": "0.7.3" } }, - "node_modules/socket.io-adapter": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", - "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", - "dev": true, - "dependencies": { - "ws": "~8.11.0" - } - }, - "node_modules/socket.io-adapter/node_modules/ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/socket.io-client": { "version": "0.9.17-overleaf-5", "resolved": "git+ssh://git@github.com/overleaf/socket.io-client.git#805a73d2a2e2408982597d5986a401088b7aa588", @@ -38718,19 +38256,6 @@ "component-emitter": "^1.3.0" } }, - "node_modules/socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", - "dev": true, - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/socket.io/node_modules/redis": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/redis/-/redis-0.7.3.tgz", @@ -39092,20 +38617,6 @@ "node": ">=0.10" } }, - "node_modules/streamroller": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz", - "integrity": "sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==", - "dev": true, - "dependencies": { - "date-format": "^4.0.3", - "debug": "^4.1.1", - "fs-extra": "^10.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/streamsearch": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", @@ -40634,25 +40145,6 @@ "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=" }, - "node_modules/ua-parser-js": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", - "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - } - ], - "engines": { - "node": "*" - } - }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -41283,15 +40775,6 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, - "node_modules/void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -44575,13 +44058,6 @@ "jquery": "^2.2.4", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", - "karma": "^6.3.17", - "karma-chai-sinon": "^0.1.5", - "karma-chrome-launcher": "^3.1.0", - "karma-mocha": "^2.0.0", - "karma-mocha-reporter": "^2.2.5", - "karma-requirejs": "^1.1.0", - "karma-webpack": "^5.0.0", "less": "^3.11.1", "less-loader": "^11.1.3", "match-sorter": "^6.2.0", @@ -45452,44 +44928,6 @@ "node": ">=12.0.0" } }, - "services/web/node_modules/karma-webpack": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz", - "integrity": "sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "webpack-merge": "^4.1.5" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "webpack": "^5.0.0" - } - }, - "services/web/node_modules/karma-webpack/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "services/web/node_modules/karma-webpack/node_modules/webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "dev": true, - "dependencies": { - "lodash": "^4.17.15" - } - }, "services/web/node_modules/lolex": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", @@ -47933,12 +47371,6 @@ "w3c-keyname": "^2.2.4" } }, - "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true - }, "@contentful/axios": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/@contentful/axios/-/axios-0.18.0.tgz", @@ -52907,13 +52339,6 @@ "jsdom-global": "^3.0.2", "json2csv": "^4.3.3", "jsonwebtoken": "^9.0.0", - "karma": "^6.3.17", - "karma-chai-sinon": "^0.1.5", - "karma-chrome-launcher": "^3.1.0", - "karma-mocha": "^2.0.0", - "karma-mocha-reporter": "^2.2.5", - "karma-requirejs": "^1.1.0", - "karma-webpack": "^5.0.0", "less": "^3.11.1", "less-loader": "^11.1.3", "lodash": "^4.17.19", @@ -53576,37 +53001,6 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.5.1.tgz", "integrity": "sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==" }, - "karma-webpack": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.0.tgz", - "integrity": "sha512-+54i/cd3/piZuP3dr54+NcFeKOPnys5QeM1IY+0SPASwrtHsliXUiCL50iW+K9WWA7RvamC4macvvQ86l3KtaA==", - "dev": true, - "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "webpack-merge": "^4.1.5" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "dev": true, - "requires": { - "lodash": "^4.17.15" - } - } - } - }, "lolex": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", @@ -54945,12 +54339,6 @@ "tslib": "^2.5.0" } }, - "@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", - "dev": true - }, "@storybook/addon-a11y": { "version": "7.0.17", "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-7.0.17.tgz", @@ -60291,12 +59679,6 @@ "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.5.tgz", "integrity": "sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==" }, - "@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, "@types/cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", @@ -60314,15 +59696,6 @@ "@types/node": "*" } }, - "@types/cors": { - "version": "2.8.13", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", - "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/cross-spawn": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.2.tgz", @@ -63850,35 +63223,6 @@ "proto-list": "~1.2.1" } }, - "connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "connect-history-api-fallback": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", @@ -64883,12 +64227,6 @@ "integrity": "sha512-xiEMER6E7TlTPnDxrM4eRiC6TRgjNX9xzEZ5U/Se2YJKr7Mq4pJn/2XEHjl3STcSh96GmkHPcBXLES8M29wyyg==", "dev": true }, - "custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true - }, "cypress": { "version": "13.3.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.3.0.tgz", @@ -65165,12 +64503,6 @@ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz", "integrity": "sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==" }, - "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 - }, "dateformat": { "version": "1.0.4-1.2.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.4-1.2.3.tgz", @@ -65467,12 +64799,6 @@ "wrappy": "1" } }, - "di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true - }, "dicer": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", @@ -65627,18 +64953,6 @@ "@babel/runtime": "^7.1.2" } }, - "dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", - "dev": true, - "requires": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" - } - }, "dom-serializer": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", @@ -65963,51 +65277,6 @@ "objectorarray": "^1.0.5" } }, - "engine.io": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.2.tgz", - "integrity": "sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA==", - "dev": true, - "requires": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.11.0" - }, - "dependencies": { - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true - }, - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true - }, - "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "requires": {} - } - } - }, - "engine.io-parser": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.1.tgz", - "integrity": "sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==", - "dev": true - }, "enhanced-resolve": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", @@ -67693,38 +66962,6 @@ "to-regex-range": "^5.0.1" } }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "find-babel-config": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.0.0.tgz", @@ -70206,12 +69443,6 @@ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true }, - "isbinaryfile": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz", - "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -71007,165 +70238,6 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" }, - "karma": { - "version": "6.3.17", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.17.tgz", - "integrity": "sha512-2TfjHwrRExC8yHoWlPBULyaLwAFmXmxQrcuFImt/JsAsSZu1uOWTZ1ZsWjqQtWpHLiatJOHL5jFjXSJIgCd01g==", - "dev": true, - "requires": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.2.0", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" - }, - "dependencies": { - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "socket.io": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.2.tgz", - "integrity": "sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw==", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "cors": "~2.8.5", - "debug": "~4.3.2", - "engine.io": "~6.5.2", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.4" - } - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - } - } - }, - "karma-chai-sinon": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/karma-chai-sinon/-/karma-chai-sinon-0.1.5.tgz", - "integrity": "sha1-XDksqVJHgYlR1rV5AvAsNugDdTo=", - "dev": true, - "requires": {} - }, - "karma-chrome-launcher": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", - "dev": true, - "requires": { - "which": "^1.2.1" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", - "dev": true, - "requires": { - "minimist": "^1.2.3" - } - }, - "karma-mocha-reporter": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz", - "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", - "dev": true, - "requires": { - "chalk": "^2.1.0", - "log-symbols": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "karma-requirejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-requirejs/-/karma-requirejs-1.1.0.tgz", - "integrity": "sha1-/driy4fX68FvsCIok1ZNf+5Xh5g=", - "dev": true, - "requires": {} - }, "keycode": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.1.tgz", @@ -71960,19 +71032,6 @@ } } }, - "log4js": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.1.tgz", - "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", - "dev": true, - "requires": { - "date-format": "^4.0.3", - "debug": "^4.3.3", - "flatted": "^3.2.4", - "rfdc": "^1.3.0", - "streamroller": "^3.0.2" - } - }, "long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -75150,12 +74209,6 @@ } } }, - "qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", - "dev": true - }, "qrcode": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.0.tgz", @@ -77134,24 +76187,6 @@ } } }, - "socket.io-adapter": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", - "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", - "dev": true, - "requires": { - "ws": "~8.11.0" - }, - "dependencies": { - "ws": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", - "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", - "dev": true, - "requires": {} - } - } - }, "socket.io-client": { "version": "git+ssh://git@github.com/overleaf/socket.io-client.git#805a73d2a2e2408982597d5986a401088b7aa588", "from": "socket.io-client@github:overleaf/socket.io-client#0.9.17-overleaf-5", @@ -77180,16 +76215,6 @@ "component-emitter": "^1.3.0" } }, - "socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", - "dev": true, - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - } - }, "sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -77479,17 +76504,6 @@ "integrity": "sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=", "dev": true }, - "streamroller": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz", - "integrity": "sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==", - "dev": true, - "requires": { - "date-format": "^4.0.3", - "debug": "^4.1.1", - "fs-extra": "^10.0.0" - } - }, "streamsearch": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", @@ -78680,12 +77694,6 @@ "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=" }, - "ua-parser-js": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", - "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", - "dev": true - }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -79160,12 +78168,6 @@ } } }, - "void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", - "dev": true - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/patches/finalhandler+1.1.2.patch b/patches/finalhandler+1.1.2.patch deleted file mode 100644 index 74f746194d..0000000000 --- a/patches/finalhandler+1.1.2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js -index 5673507..40f4684 100644 ---- a/node_modules/finalhandler/index.js -+++ b/node_modules/finalhandler/index.js -@@ -125,7 +125,7 @@ function finalhandler (req, res, options) { - // cannot actually respond - if (headersSent(res)) { - debug('cannot %d after headers sent', status) -- req.socket.destroy() -+ if (req.socket) req.socket.destroy() - return - } - diff --git a/services/web/.eslintrc b/services/web/.eslintrc index f962c69e27..85819a2a86 100644 --- a/services/web/.eslintrc +++ b/services/web/.eslintrc @@ -37,7 +37,6 @@ "**/app/src/**/*.js", "app.js", "i18next-scanner.config.js", - "karma.conf.js", "scripts/**/*.js", "webpack.config*.js" ], @@ -82,14 +81,6 @@ "mocha/prefer-arrow-callback": "error" } }, - { - // Frontend test specific rules - "files": ["**/test/karma/**/*.js"], - "globals": { - "expect": true, - "$": true - } - }, { // Backend specific rules "files": ["**/app/src/**/*.js", "app.js"], diff --git a/services/web/Makefile b/services/web/Makefile index 09b7e63df4..9826daf02b 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -45,8 +45,6 @@ clean: -COMPOSE_PROJECT_NAME=acceptance_modules_merged_saas_4_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local -COMPOSE_PROJECT_NAME=acceptance_modules_merged_server_ce_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local -COMPOSE_PROJECT_NAME=acceptance_modules_merged_server_pro_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local - -COMPOSE_PROJECT_NAME=karma_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local - -COMPOSE_PROJECT_NAME=karma_test_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local -COMPOSE_PROJECT_NAME=frontend_test_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local -COMPOSE_PROJECT_NAME=tar_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down --rmi local @@ -60,7 +58,7 @@ clean_ci: # Tests # -test: test_unit test_karma test_acceptance test_frontend test_frontend_ct +test: test_unit test_acceptance test_frontend test_frontend_ct test_module: test_unit_module test_acceptance_module @@ -115,18 +113,6 @@ test_unit_modules: $(TEST_UNIT_MODULES) test_unit_module: $(MAKE) modules/$(MODULE_NAME)/test_unit -# -# Karma frontend tests -# - -test_karma: build_test_karma test_karma_run - -test_karma_run: - COMPOSE_PROJECT_NAME=karma_test_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 - COMPOSE_PROJECT_NAME=karma_test_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) run --rm test_karma - COMPOSE_PROJECT_NAME=karma_test_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) down -v -t 0 - -test_karma_build_run: build_test_karma test_karma_run # # Frontend tests @@ -445,7 +431,7 @@ lint_test_modules: --max-warnings=0 lint: lint_misc -# migrations, scripts, webpack config, karma config +# migrations, scripts, webpack config lint_misc: npx eslint . \ --ignore-pattern 'app.{js,jsx,mjs,ts,tsx}' \ @@ -558,9 +544,6 @@ build: --file Dockerfile \ ../.. -build_test_karma: - COMPOSE_PROJECT_NAME=karma_$(BUILD_DIR_NAME) $(DOCKER_COMPOSE) build test_karma - publish: docker push $(DOCKER_REPO)/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) @@ -583,7 +566,7 @@ $(MODULE_TARGETS): $(MODULE_TARGETS) \ compile_modules compile_modules_full clean_ci \ test test_module test_unit test_unit_app \ - test_unit_modules test_unit_module test_karma test_karma_run \ - test_karma_build_run test_frontend test_acceptance test_acceptance_app \ - test_acceptance_modules test_acceptance_module ci format format_fix lint \ - build build_test_karma publish tar + test_unit_modules test_unit_module test_frontend \ + test_acceptance test_acceptance_app test_acceptance_modules \ + test_acceptance_module ci format format_fix lint \ + build publish tar diff --git a/services/web/docker-compose.ci.yml b/services/web/docker-compose.ci.yml index be9c5bde50..60a4667202 100644 --- a/services/web/docker-compose.ci.yml +++ b/services/web/docker-compose.ci.yml @@ -38,20 +38,6 @@ services: - saml - ldap - test_karma: - build: - context: ../.. - dockerfile: services/web/Dockerfile.frontend.ci - args: - PROJECT_NAME: $PROJECT_NAME - BRANCH_NAME: $BRANCH_NAME - BUILD_NUMBER: $BUILD_NUMBER - working_dir: /overleaf/services/web - command: npm run test:karma:single - user: node - environment: - NODE_OPTIONS: "--unhandled-rejections=strict" - test_frontend: build: context: ../.. diff --git a/services/web/docker-compose.yml b/services/web/docker-compose.yml index 968ab6c853..4ed2143287 100644 --- a/services/web/docker-compose.yml +++ b/services/web/docker-compose.yml @@ -46,19 +46,6 @@ services: - ldap command: npm run --silent test:acceptance:app - test_karma: - build: - context: ../.. - dockerfile: services/web/Dockerfile.frontend - volumes: - - .:/overleaf/services/web - - ../../node_modules:/overleaf/node_modules - - ../../libraries:/overleaf/libraries - environment: - NODE_OPTIONS: "--unhandled-rejections=strict" - working_dir: /overleaf/services/web - command: npm run --silent test:karma:single - test_frontend: build: context: ../.. diff --git a/services/web/karma.conf.js b/services/web/karma.conf.js deleted file mode 100644 index 7f42224f6d..0000000000 --- a/services/web/karma.conf.js +++ /dev/null @@ -1,65 +0,0 @@ -const webpackConfig = require('./webpack.config.test') - -module.exports = function (config) { - config.set({ - customLaunchers: { - ChromeCustom: { - base: 'ChromeHeadless', - // We must disable the Chrome sandbox when running Chrome inside Docker - // (Chrome's sandbox needs more permissions than Docker allows by - // default) - flags: ['--no-sandbox'], - }, - }, - browsers: ['ChromeCustom'], - files: [ - // Import all tests (see comment in the file for why this is necessary) - 'test/karma/import_tests.js', - ], - middleware: ['fake-img'], - preprocessors: { - // Run files through webpack - 'test/karma/import_tests.js': ['webpack'], - }, - frameworks: ['mocha', 'chai-sinon'], - // Configure webpack in the tests - webpack: webpackConfig, - // Configure the webpack dev server used to serve test files - webpackMiddleware: { - // Disable file-watching -- it is of no use in CI, we use single runs. - // https://webpack.js.org/configuration/watch/ - watch: false, - // ^ does not work when placed in webpack.config.test. - // webpack-dev-middleware overrides it :/ - // v seems to be supported, according to - // https://www.npmjs.com/package/webpack-dev-middleware#watchoptions - watchOptions: { - ignored: [/node_modules/, /frontend/, /test/], - }, - - // Disable noisy CLI output - stats: 'errors-only', - }, - plugins: [ - require('karma-chrome-launcher'), - require('karma-mocha'), - require('karma-chai-sinon'), - require('karma-webpack'), - require('karma-mocha-reporter'), - { 'middleware:fake-img': ['factory', fakeImgMiddlewareFactory] }, - ], - reporters: ['mocha'], - }) -} - -/** - * Handle fake images - */ -function fakeImgMiddlewareFactory() { - return function (req, res, next) { - if (req.originalUrl.startsWith('/fake/')) { - return res.end('fake img response') - } - next() - } -} diff --git a/services/web/package.json b/services/web/package.json index aed5d278d3..5b5c38e490 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -15,8 +15,6 @@ "test:unit:app": "npm run test:unit:run_dir -- test/unit/src", "test:frontend": "NODE_ENV=test TZ=GMT mocha --recursive --timeout 5000 --exit --extension js,jsx,mjs,ts,tsx --grep=$MOCHA_GREP --require test/frontend/bootstrap.js --ignore '**/*.spec.{js,jsx,ts,tsx}' test/frontend modules/*/test/frontend", "test:frontend:coverage": "c8 --all --include 'frontend/js' --include 'modules/*/frontend/js' --exclude 'frontend/js/vendor' --reporter=lcov --reporter=text-summary npm run test:frontend", - "test:karma": "karma start", - "test:karma:single": "karma start --no-auto-watch --single-run", "start": "node $NODE_APP_OPTIONS app.js", "nodemon": "node --watch $NODE_APP_OPTIONS app.js --watch-locales", "webpack": "webpack serve --config webpack.config.dev.js", @@ -58,7 +56,7 @@ "local:test:acceptance": "npm run local:test:acceptance:app && npm run local:test:acceptance:modules", "local:test:unit": "npm run test:unit:all", "local:test:frontend": "npm run test:frontend", - "local:test": "npm run local:test:unit && npm run local:test:frontend && npm run test:karma:single && npm run local:test:acceptance" + "local:test": "npm run local:test:unit && npm run local:test:frontend && npm run local:test:acceptance" }, "browserslist": [ "last 1 year", @@ -289,13 +287,6 @@ "jquery": "^2.2.4", "jsdom": "^19.0.0", "jsdom-global": "^3.0.2", - "karma": "^6.3.17", - "karma-chai-sinon": "^0.1.5", - "karma-chrome-launcher": "^3.1.0", - "karma-mocha": "^2.0.0", - "karma-mocha-reporter": "^2.2.5", - "karma-requirejs": "^1.1.0", - "karma-webpack": "^5.0.0", "less": "^3.11.1", "less-loader": "^11.1.3", "match-sorter": "^6.2.0", diff --git a/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js b/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js deleted file mode 100644 index 1e30e2e309..0000000000 --- a/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js +++ /dev/null @@ -1,308 +0,0 @@ -/* eslint-disable - max-len, -*/ -/* global inject, sinon */ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -import SpellCheckManager from '../../../../../../frontend/js/ide/editor/directives/aceEditor/spell-check/SpellCheckManager' - -export default describe('SpellCheckManager', function () { - beforeEach(function (done) { - this.timelord = sinon.useFakeTimers() - window.user = { id: 1 } - window.csrfToken = 'token' - this.scope = { - $watch: sinon.stub(), - spellCheck: true, - spellCheckLanguage: 'en', - } - this.highlightedWordManager = { - reset: sinon.stub(), - clearRow: sinon.stub(), - addHighlight: sinon.stub(), - } - this.adapter = { - getLineCount: sinon.stub(), - getFirstVisibleRowNum: sinon.stub(), - getLastVisibleRowNum: sinon.stub(), - getLinesByRows: sinon.stub(), - highlightedWordManager: this.highlightedWordManager, - } - return inject(($q, $http, $httpBackend, $cacheFactory) => { - this.$http = $http - this.$q = $q - this.$httpBackend = $httpBackend - this.spellCheckManager = new SpellCheckManager( - this.scope, - $cacheFactory, - $http, - $q, - this.adapter - ) - return done() - }) - }) - - afterEach(function () { - return this.timelord.restore() - }) - - it('adds an highlight when a misspelling is found', function () { - this.$httpBackend.when('POST', '/spelling/check').respond({ - misspellings: [ - { - index: 0, - suggestions: ['opposition'], - }, - ], - }) - this.adapter.getLinesByRows.returns(['oppozition']) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - expect(this.highlightedWordManager.addHighlight).to.have.been.called - }) - - describe('runSpellCheck', function () { - beforeEach(function () { - this.adapter.getLineCount.returns(10) - this.adapter.getFirstVisibleRowNum.returns(3) - this.adapter.getLastVisibleRowNum.returns(5) - this.adapter.getLinesByRows.returns([ - 'Lorem ipsum dolor sit amet', - 'consectetur adipisicing elit', - 'sed do eiusmod', - ]) - this.$httpBackend.when('POST', '/spelling/check').respond({ - misspellings: [ - { - index: 0, - suggestions: ['opposition'], - }, - ], - }) - }) - describe('when doing the first check', function () { - beforeEach(function () { - this.spellCheckManager.init() - }) - it('initially flags all lines as dirty ', function () { - expect(this.spellCheckManager.changedLines) - .to.have.lengthOf(10) - .and.to.not.include(false) - }) - it('checks beyond the currently visible viewport', function () { - this.timelord.tick(500) - this.$httpBackend.flush() - expect(this.adapter.getLinesByRows).to.have.been.calledWith([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - ]) - }) - }) - describe('after the initial check', function () { - beforeEach(function () { - this.spellCheckManager.init() - this.spellCheckManager.firstCheck = false - }) - - it('only checks visible lines', function () { - this.spellCheckManager.runSpellCheck() - this.spellCheckManager.timeoutId = null - this.$httpBackend.flush() - expect(this.adapter.getLinesByRows).to.have.been.calledWith([3, 4, 5]) - }) - - it('flags checked lines as non-dirty', function () { - this.spellCheckManager.runSpellCheck() - this.spellCheckManager.timeoutId = null - this.$httpBackend.flush() - expect(this.spellCheckManager.changedLines[2]).to.equal(true) - expect(this.spellCheckManager.changedLines[3]).to.equal(false) - expect(this.spellCheckManager.changedLines[4]).to.equal(false) - expect(this.spellCheckManager.changedLines[5]).to.equal(false) - expect(this.spellCheckManager.changedLines[6]).to.equal(true) - }) - - it('ignores updated lines', function () { - this.spellCheckManager.changedLines[4] = false - this.spellCheckManager.runSpellCheck() - this.spellCheckManager.timeoutId = null - this.$httpBackend.flush() - expect(this.adapter.getLinesByRows).to.have.been.calledWith([3, 5]) - }) - - it('clears highlights for changed lines', function () { - this.spellCheckManager.runSpellCheck() - this.spellCheckManager.timeoutId = null - this.$httpBackend.flush() - expect( - this.highlightedWordManager.clearRow.getCall(0).args[0] - ).to.equal(3) - expect( - this.highlightedWordManager.clearRow.getCall(1).args[0] - ).to.equal(4) - expect( - this.highlightedWordManager.clearRow.getCall(2).args[0] - ).to.equal(5) - }) - }) - }) - - describe('cache', function () { - beforeEach(function () { - this.adapter.getLineCount.returns(1) - this.adapter.getFirstVisibleRowNum.returns(1) - this.adapter.getLastVisibleRowNum.returns(1) - this.adapter.getLinesByRows.returns(['Lorem ipsum dolor']) - this.$httpBackend.when('POST', '/spelling/check').respond({ - misspellings: [ - { - index: 0, - suggestions: ['foobarbaz'], - }, - ], - }) - }) - - it('adds already checked words to the spellchecker cache', function () { - expect(this.spellCheckManager.cache.info().size).to.equal(0) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - expect(this.spellCheckManager.cache.info().size).to.equal(3) - }) - - it('adds misspeled word suggestions to the cache', function () { - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - - expect( - this.spellCheckManager.cache.get( - `${this.scope.spellCheckLanguage}:Lorem` - ) - ).to.eql(['foobarbaz']) - }) - - it('adds non-misspeled words to the cache as a boolean', function () { - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - expect( - this.spellCheckManager.cache.get( - `${this.scope.spellCheckLanguage}:ipsum` - ) - ).to.equal(true) - }) - }) - - describe('backend', function () { - beforeEach(function () { - this.adapter.getLineCount.returns(1) - this.adapter.getFirstVisibleRowNum.returns(1) - this.adapter.getLastVisibleRowNum.returns(1) - this.adapter.getLinesByRows.returns([ - 'Lorem \\somecommand ipsum dolor \\othercommand', - ]) - }) - - it('hits the backend with all words at startup', function () { - this.$httpBackend - .expect('POST', '/spelling/check', { - language: this.scope.spellCheckLanguage, - words: ['Lorem', 'ipsum', 'dolor'], - skipLearnedWords: true, - token: window.user.id, - _csrf: window.csrfToken, - }) - .respond({ - misspellings: [ - { - index: 0, - suggestions: ['foobarbaz'], - }, - ], - }) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - }) - - it('does not hit the backend when all words are already in the cache', function () { - this.$httpBackend - .expect('POST', '/spelling/check', { - language: this.scope.spellCheckLanguage, - words: ['Lorem', 'ipsum', 'dolor'], - skipLearnedWords: true, - token: window.user.id, - _csrf: window.csrfToken, - }) - .respond({ - misspellings: [ - { - index: 0, - suggestions: ['foobarbaz'], - }, - ], - }) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - this.spellCheckManager.init() - this.timelord.tick(500) - }) - - it('hits the backend only with non-cached words', function () { - this.$httpBackend - .expect('POST', '/spelling/check', { - language: this.scope.spellCheckLanguage, - words: ['Lorem', 'ipsum', 'dolor'], - skipLearnedWords: true, - token: window.user.id, - _csrf: window.csrfToken, - }) - .respond({ - misspellings: [ - { - index: 0, - suggestions: ['foobarbaz'], - }, - ], - }) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - - this.adapter.getLinesByRows.returns(['Lorem ipsum dolor sit amet']) - this.$httpBackend - .expect('POST', '/spelling/check', { - language: this.scope.spellCheckLanguage, - words: ['sit', 'amet'], - skipLearnedWords: true, - token: window.user.id, - _csrf: window.csrfToken, - }) - .respond({ - misspellings: [ - { - index: 0, - suggestions: ['bazbarfoo'], - }, - ], - }) - this.spellCheckManager.init() - this.timelord.tick(500) - this.$httpBackend.flush() - }) - - afterEach(function () { - this.$httpBackend.verifyNoOutstandingRequest() - this.$httpBackend.verifyNoOutstandingExpectation() - }) - }) -}) diff --git a/services/web/test/karma/ide/history/HistoryV2ManagerTests.js b/services/web/test/karma/ide/history/HistoryV2ManagerTests.js deleted file mode 100644 index 7a37983a1b..0000000000 --- a/services/web/test/karma/ide/history/HistoryV2ManagerTests.js +++ /dev/null @@ -1,649 +0,0 @@ -/* eslint-disable - max-len, - no-return-assign, -*/ -/* global inject, sinon */ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -import HistoryV2Manager from '../../../../frontend/js/ide/history/HistoryV2Manager' - -export default describe('HistoryV2Manager', function () { - beforeEach(function (done) { - this.defaultHistoryScope = { - updates: [], - viewMode: 'point_in_time', - nextBeforeTimestamp: null, - loading: false, - atEnd: false, - userHasFullFeature: undefined, - freeHistoryLimitHit: false, - selection: { - docs: {}, - pathname: null, - range: { - fromV: null, - toV: null, - }, - hoveredRange: { - fromV: null, - toV: null, - }, - diff: null, - files: [], - file: null, - }, - error: null, - showOnlyLabels: false, - labels: null, - loadingFileTree: true, - isReact: false, - } - - this.sampleUpdates = [ - { - fromV: 4, - toV: 5, - meta: { - users: [ - { - first_name: 'john.doe', - last_name: '', - email: 'john.doe@domain.tld', - id: '5b57299087712202fb599ab4', - hue: 200, - }, - ], - start_ts: 1544021278346, - end_ts: 1544021278346, - }, - labels: [ - { - id: '5c07e822042e67003b448f18', - comment: 'My first label', - version: 5, - user_id: '5b57299087712202fb599ab4', - created_at: '2018-12-05T15:00:50.688Z', - }, - ], - pathnames: [], - project_ops: [ - { - add: { - pathname: 'chapters/chapter1.tex', - }, - atV: 4, - }, - ], - }, - { - fromV: 3, - toV: 4, - meta: { - users: [ - { - first_name: 'john.doe', - last_name: '', - email: 'john.doe@domain.tld', - id: '5b57299087712202fb599ab4', - hue: 200, - }, - ], - start_ts: 1544021262622, - end_ts: 1544021262622, - }, - labels: [], - pathnames: ['main.tex'], - project_ops: [], - }, - { - fromV: 0, - toV: 3, - meta: { - users: [ - { - first_name: 'john.doe', - last_name: '', - email: 'john.doe@domain.tld', - id: '5b57299087712202fb599ab4', - hue: 200, - }, - ], - start_ts: 1544021213540, - end_ts: 1544021213618, - }, - labels: [], - pathnames: [], - project_ops: [ - { - add: { - pathname: 'universe.jpg', - }, - atV: 2, - }, - { - add: { - pathname: 'references.bib', - }, - atV: 1, - }, - { - add: { - pathname: 'main.tex', - }, - atV: 0, - }, - ], - }, - ] - - inject(($q, $http, $filter, $rootScope) => { - this.$scope = $rootScope.$new() - this.$scope.project = { - features: { - versioning: true, - }, - } - this.$scope.user = { - isAdmin: false, - } - this.ide = { - globalEditorWatchdogManager: { attachToEditor() {} }, - $q, - $http, - $filter, - } - this.eventTracking = { - sendMB: () => {}, - } - this.localStorage = sinon.stub().returns(null) - this.historyManager = new HistoryV2Manager( - this.ide, - this.$scope, - this.localStorage, - this.eventTracking - ) - done() - }) - }) - - it('should setup the history scope on initialization', function () { - expect(this.$scope.history).to.deep.equal(this.defaultHistoryScope) - }) - - it('should keep history updates after performing a soft reset', function () { - const historyScopeWithUpdates = Object.assign( - {}, - this.defaultHistoryScope, - { - updates: this.sampleUpdates, - } - ) - this.$scope.history.updates = this.sampleUpdates - this.historyManager.softReset() - expect(this.$scope.history).to.deep.equal(historyScopeWithUpdates) - }) - - it('should discard history updates after performing a hard reset', function () { - this.$scope.history.updates = this.sampleUpdates - this.historyManager.hardReset() - expect(this.$scope.history).to.deep.equal(this.defaultHistoryScope) - }) - - it('should setup history with full access to the feature if the project has versioning', function () { - this.$scope.$digest() - expect(this.$scope.history.userHasFullFeature).to.equal(true) - }) - - it('should setup history without full access to the feature if the project does not have versioning', function () { - this.$scope.project.features.versioning = false - this.historyManager = new HistoryV2Manager( - this.ide, - this.$scope, - this.localStorage - ) - this.$scope.$digest() - expect(this.$scope.history.userHasFullFeature).to.equal(false) - }) - - it('should setup history with full access to the feature for admin users even if the project does not have versioning', function () { - this.$scope.project.features.versioning = false - this.$scope.user.isAdmin = true - this.historyManager = new HistoryV2Manager( - this.ide, - this.$scope, - this.localStorage - ) - this.$scope.$digest() - expect(this.$scope.history.userHasFullFeature).to.equal(true) - }) - - describe('autoSelectFile', function () { - describe('for compare mode', function () { - beforeEach(function () { - this.mockedFilesList = [ - { - pathname: 'main.tex', - }, - { - pathname: 'references.bib', - }, - { - pathname: 'universe.jpg', - }, - { - pathname: 'chapters/chapter2.tex', - }, - { - pathname: 'chapters/draft.tex', - operation: 'removed', - deletedAtV: 47, - }, - { - pathname: 'chapters/chapter3.tex', - operation: 'added', - }, - { - pathname: 'chapters/chapter1.tex', - operation: 'edited', - }, - { - pathname: 'chapters/foo.tex', - oldPathname: 'chapters/bar.tex', - operation: 'renamed', - }, - ] - this.mockedMainTex = this.mockedFilesList[0] - this.mockedReferencesFile = this.mockedFilesList[1] - this.mockedRemovedFile = this.mockedFilesList[4] - this.mockedAddedFile = this.mockedFilesList[5] - this.mockedEditedFile = this.mockedFilesList[6] - this.mockedRenamedFile = this.mockedFilesList[7] - - this.$scope.history.viewMode = 'compare' - this.$scope.history.selection.files = this.mockedFilesList - }) - - describe('with a previously selected file', function () { - it('should prefer the previously selected file if it is available and has operations', function () { - this.historyManager._previouslySelectedPathname = - this.mockedAddedFile.pathname - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedAddedFile - ) - }) - - it('should prefer a file with ops if the previously selected file is available but has no operations', function () { - this.historyManager._previouslySelectedPathname = - this.mockedReferencesFile.pathname - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.operation).to.exist - }) - - it('should ignore the previously selected file if it is not available', function () { - this.historyManager._previouslySelectedPathname = 'non/existent.file' - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.not.equal( - 'non/existent.file' - ) - }) - }) - - describe('without a previously selected file, with a list of files containing operations', function () { - it('should prefer edited files', function () { - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedEditedFile - ) - }) - - it('should prefer added files if no edited files are present', function () { - const indexOfEditedFile = this.$scope.history.selection.files.indexOf( - this.mockedEditedFile - ) - this.$scope.history.selection.files.splice(indexOfEditedFile, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedAddedFile - ) - }) - - it('should prefer renamed files if no edited or added files are present', function () { - const indexOfEditedFile = this.$scope.history.selection.files.indexOf( - this.mockedEditedFile - ) - this.$scope.history.selection.files.splice(indexOfEditedFile, 1) - const indexOfAddedFile = this.$scope.history.selection.files.indexOf( - this.mockedAddedFile - ) - this.$scope.history.selection.files.splice(indexOfAddedFile, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedRenamedFile - ) - }) - - it('should prefer removed files if no edited, added or renamed files are present', function () { - const indexOfEditedFile = this.$scope.history.selection.files.indexOf( - this.mockedEditedFile - ) - this.$scope.history.selection.files.splice(indexOfEditedFile, 1) - const indexOfAddedFile = this.$scope.history.selection.files.indexOf( - this.mockedAddedFile - ) - this.$scope.history.selection.files.splice(indexOfAddedFile, 1) - const indexOfRenamedFile = - this.$scope.history.selection.files.indexOf(this.mockedRenamedFile) - this.$scope.history.selection.files.splice(indexOfRenamedFile, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedRemovedFile - ) - }) - }) - - describe('without a previously selected file, with a list of files without operations', function () { - beforeEach(function () { - this.mockedFilesListWithNoOps = [ - { - pathname: 'main.tex', - }, - { - pathname: 'references.bib', - }, - { - pathname: 'other.tex', - }, - { - pathname: 'universe.jpg', - }, - ] - this.mockedMainTex = this.mockedFilesListWithNoOps[0] - this.mockedReferencesFile = this.mockedFilesListWithNoOps[1] - this.mockedOtherTexFile = this.mockedFilesListWithNoOps[2] - - this.$scope.history.selection.files = this.mockedFilesListWithNoOps - }) - - it('should prefer main.tex if it exists', function () { - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedMainTex - ) - }) - - it('should prefer another tex file if main.tex does not exist', function () { - const indexOfMainTex = this.$scope.history.selection.files.indexOf( - this.mockedMainTex - ) - this.$scope.history.selection.files.splice(indexOfMainTex, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedOtherTexFile - ) - }) - - it('should pick the first available file if no tex files are available', function () { - const indexOfMainTex = this.$scope.history.selection.files.indexOf( - this.mockedMainTex - ) - this.$scope.history.selection.files.splice(indexOfMainTex, 1) - const indexOfOtherTexFile = - this.$scope.history.selection.files.indexOf(this.mockedOtherTexFile) - this.$scope.history.selection.files.splice(indexOfOtherTexFile, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file).to.deep.equal( - this.mockedReferencesFile - ) - }) - }) - }) - - describe('for point-in-time mode', function () { - beforeEach(function () { - this.$scope.history.viewMode = 'point_in_time' - this.sampleUpdates[0] = { - fromV: 4, - toV: 5, - meta: { - users: [ - { - first_name: 'john.doe', - last_name: '', - email: 'john.doe@domain.tld', - id: '5b57299087712202fb599ab4', - hue: 200, - }, - ], - start_ts: 1544021278346, - end_ts: 1544021278346, - }, - pathnames: ['main.tex'], - project_ops: [ - { - add: { - pathname: 'chapters/chapter1.tex', - }, - atV: 4, - }, - { - rename: { - pathname: 'foo.tex', - newPathname: 'bar.tex', - }, - }, - ], - } - this.sampleUpdateEditedFile = this.sampleUpdates[0].pathnames[0] - this.sampleUpdateAddedFile = - this.sampleUpdates[0].project_ops[0].add.pathname - this.sampleUpdateRenamedFile = - this.sampleUpdates[0].project_ops[1].rename.newPathname - this.$scope.history.updates = this.sampleUpdates - this.$scope.history.selection.range = { - fromV: this.sampleUpdates[0].toV, - toV: this.sampleUpdates[0].toV, - } - this.mockedFilesList = [ - { - pathname: 'main.tex', - }, - { - pathname: 'references.bib', - }, - { - pathname: 'universe.jpg', - }, - { - pathname: 'chapters/chapter2.tex', - }, - { - pathname: 'chapters/draft.tex', - }, - { - pathname: 'chapters/chapter3.tex', - }, - { - pathname: 'chapters/chapter1.tex', - }, - { - pathname: 'bar.tex', - }, - ] - this.$scope.history.selection.files = this.mockedFilesList - }) - - describe('with a previously selected file', function () { - it('should prefer the previously selected file if it is available and has operations', function () { - this.historyManager._previouslySelectedPathname = 'main.tex' - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.sampleUpdateEditedFile - ) - }) - - it('should prefer a file with ops if the previously selected file is available but has no operations', function () { - this.historyManager._previouslySelectedPathname = 'main.tex' - this.sampleUpdates[0].pathnames = [] - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.sampleUpdateAddedFile - ) - }) - - it('should ignore the previously selected file if it is not available', function () { - this.historyManager._previouslySelectedPathname = 'non/existent.file' - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.not.equal( - 'non/existent.file' - ) - }) - }) - - describe('without a previously selected file, with a list of files containing operations', function () { - it('should prefer edited files', function () { - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.sampleUpdateEditedFile - ) - }) - - it('should prefer added files if no edited files are present', function () { - this.sampleUpdates[0].pathnames = [] - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.sampleUpdateAddedFile - ) - }) - - it('should prefer renamed files if no edited or added files are present', function () { - this.sampleUpdates[0].pathnames = [] - this.sampleUpdates[0].project_ops.shift() - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.sampleUpdateRenamedFile - ) - }) - }) - - describe('without a previously selected file, with a list of files without operations', function () { - beforeEach(function () { - this.sampleUpdates[0].pathnames = [] - this.sampleUpdates[0].project_ops = [] - this.mockedMainTex = this.mockedFilesList[0] - this.mockedReferencesFile = this.mockedFilesList[1] - }) - - it('should prefer main.tex if it exists', function () { - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.equal( - this.mockedMainTex.pathname - ) - }) - - it('should prefer another tex file if main.tex does not exist', function () { - const indexOfMainTex = this.$scope.history.selection.files.indexOf( - this.mockedMainTex - ) - this.$scope.history.selection.files.splice(indexOfMainTex, 1) - this.historyManager.autoSelectFile() - expect(this.$scope.history.selection.file.pathname).to.match(/.tex$/) - }) - }) - }) - - describe('_loadLabels', function () { - it('should return labels list as is if there is a label for the last version', function () { - const labels = [ - { - id: '1', - version: 1, - comment: 'foo', - created_at: new Date().toISOString(), - }, - { - id: '2', - version: 2, - comment: 'bar', - created_at: new Date().toISOString(), - }, - { - id: '3', - version: 3, - comment: 'baz', - created_at: new Date().toISOString(), - }, - ] - const lastUpdate = 3 - - const labelsResult = this.historyManager._loadLabels(labels, lastUpdate) - - expect(labelsResult).to.have.members(labels) - }) - - it('should return a labels list with a pseudo current state label if there is no label for the last version', function () { - const labels = [ - { - id: '1', - version: 1, - comment: 'foo', - created_at: new Date().toISOString(), - }, - { - id: '2', - version: 2, - comment: 'bar', - created_at: new Date().toISOString(), - }, - { - id: '3', - version: 3, - comment: 'baz', - created_at: new Date().toISOString(), - }, - ] - const lastUpdate = 5 - - const labelsResult = this.historyManager._loadLabels(labels, lastUpdate) - - expect(labelsResult).to.include.members(labels) - expect(labelsResult[0].isPseudoCurrentStateLabel).to.equal(true) - expect(labelsResult[0].version).to.equal(5) - }) - - it('should keep pseudo label when deleting label', function () { - this.historyManager.$scope.history.labels = [ - { - id: '1', - version: 1, - comment: 'foo', - created_at: new Date().toISOString(), - }, - ] - const lastUpdate = 5 - - this.historyManager.$scope.history.labels = - this.historyManager._loadLabels( - this.historyManager.$scope.history.labels, - lastUpdate - ) - - expect( - this.historyManager.$scope.history.labels[0].isPseudoCurrentStateLabel - ).to.equal(true) - - this.historyManager.$scope.history.labels = - this.historyManager._loadLabels([], lastUpdate) - expect( - this.historyManager.$scope.history.labels[0].isPseudoCurrentStateLabel - ).to.equal(true) - expect(this.historyManager.$scope.history.labels[0].version).to.equal(5) - }) - }) - }) -}) diff --git a/services/web/test/karma/import_tests.js b/services/web/test/karma/import_tests.js deleted file mode 100644 index 412fcad96d..0000000000 --- a/services/web/test/karma/import_tests.js +++ /dev/null @@ -1,45 +0,0 @@ -/* global chai */ - -// Allow for mocking of Angular -import 'angular' -import 'angular-mocks' - -/** - * Add chai assertion for comparing CodeMirror Pos objects. - * A deep comparison will fail because CodeMirror inserts additional properties - * that we want to ignore. - */ -chai.Assertion.addMethod('equalPos', function (expectedPos) { - const { line: actualLine, ch: actualCh } = this._obj - const { line: expectedLine, ch: expectedCh } = expectedPos - - this.assert( - actualLine === expectedLine && actualCh === expectedCh, - `expected #{exp} to equal #{act}`, - `expected #{exp} to not equal #{act}`, - `Pos({ line: ${expectedLine}, ch: ${expectedCh} })`, - `Pos({ line: ${actualLine}, ch: ${actualCh} })` - ) -}) - -// Mock ExposedSettings -window.ExposedSettings = {} - -/* - * Bundle all test files together into a single bundle, and run tests against - * this single bundle. - * We are using karma-webpack to bundle our tests and the 'default' strategy is - * to create a bundle for each test file. This isolates the tests better, but - * causes a problem with Angular. The issue with Angular tests is because we - * load a single global copy of Angular (see karma.conf.js) but - * frontend/js/base.js is included in each bundle, meaning the Angular app is - * initialised for each bundle when it is loaded onto the page when Karma - * starts. This means that only the last bundle will have controllers/directives - * registered against it, ultimately meaning that all other bundles will fail - * because Angular cannot find the controller/directive under test. - */ - -// Import from the top-level any JS files within a test/karma -// directory -const context = require.context('../../', true, /test\/karma\/.*\.js$/) -context.keys().forEach(context) diff --git a/services/web/test/karma/support/fixture.js b/services/web/test/karma/support/fixture.js deleted file mode 100644 index 4d2235aa82..0000000000 --- a/services/web/test/karma/support/fixture.js +++ /dev/null @@ -1,18 +0,0 @@ -class Fixture { - constructor() { - this.el = document.createElement('div') - document.body.appendChild(this.el) - } - - load(html) { - this.el.innerHTML = html - return this.el.firstChild - } - - cleanUp() { - this.el.innerHTML = '' - } -} - -const fixture = new Fixture() -export default fixture diff --git a/services/web/webpack.config.test.js b/services/web/webpack.config.test.js deleted file mode 100644 index be76b8a495..0000000000 --- a/services/web/webpack.config.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const MiniCssExtractPlugin = require('mini-css-extract-plugin') -const { merge } = require('webpack-merge') - -const base = require('./webpack.config') - -const config = merge(base, { - mode: 'development', - - plugins: [new MiniCssExtractPlugin()], -}) - -// Karma configures entry & output for us, so disable these -delete config.entry -delete config.output - -module.exports = config