]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat: prepare jest upgrade and ts testing
authorJohn Molakvoæ <skjnldsv@protonmail.com>
Wed, 14 Jun 2023 08:49:40 +0000 (10:49 +0200)
committerJohn Molakvoæ <skjnldsv@protonmail.com>
Wed, 21 Jun 2023 07:08:04 +0000 (09:08 +0200)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
__mocks__/@nextcloud/auth.js [new file with mode: 0644]
__mocks__/svg.js [new file with mode: 0644]
__tests__/jest-setup.ts [new file with mode: 0644]
custom.d.ts
jest.config.js [deleted file]
jest.config.ts [new file with mode: 0644]
package-lock.json
package.json
tests/jestSetup.js [deleted file]

diff --git a/__mocks__/@nextcloud/auth.js b/__mocks__/@nextcloud/auth.js
new file mode 100644 (file)
index 0000000..ba0ae21
--- /dev/null
@@ -0,0 +1,15 @@
+import { c } from "tar"
+
+export const getCurrentUser = function() {
+       return {
+               uid: 'test',
+               displayName: 'Test',
+               isAdmin: false,
+       }
+}
+
+export const getRequestToken = function() {
+       return 'test-token-1234'
+}
+
+export const onRequestTokenUpdate = function() {}
diff --git a/__mocks__/svg.js b/__mocks__/svg.js
new file mode 100644 (file)
index 0000000..7e40e29
--- /dev/null
@@ -0,0 +1 @@
+module.exports = 'SvgMock'
diff --git a/__tests__/jest-setup.ts b/__tests__/jest-setup.ts
new file mode 100644 (file)
index 0000000..c0813ff
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @copyright 2021 François Freitag <mail@franek.fr>
+ *
+ * @author François Freitag <mail@franek.fr>
+ *
+ * @license AGPL-3.0-or-later
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+import '@testing-library/jest-dom'
index 7f6487fb8359d37fb2c27e4b31bac8ad35640616..6a7b595c981f5c5d24367cfd96f193cbdfc179e1 100644 (file)
@@ -24,6 +24,11 @@ declare module '*.svg?raw' {
        export default content
 }
 
+declare module '*.svg' {
+       const content: any
+       export default content
+}
+
 declare module '*.vue' {
        import Vue from 'vue'
        export default Vue
diff --git a/jest.config.js b/jest.config.js
deleted file mode 100644 (file)
index 054ea71..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@pm.me>
- *
- * @author Marco Ambrosini <marcoambrosini@pm.me>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-// TODO: find a way to consolidate this in one place, with webpack.common.js
-const ignorePatterns = [
-       'vue-material-design-icons',
-       '@juliushaertl',
-       'tributejs',
-       '@nextcloud/vue',
-       'splitpanes',
-       'string-length',
-       'strip-ansi',
-       'ansi-regex',
-       'char-regex',
-]
-
-module.exports = {
-       testMatch: ['<rootDir>/apps/*/src/**/*.(spec|test).(ts|js)'],
-       modulePathIgnorePatterns: ["<rootDir>/apps-extra/"],
-       transformIgnorePatterns: [
-               'node_modules/(?!(' + ignorePatterns.join('|') + ')/)',
-       ],
-    setupFilesAfterEnv: ['<rootDir>/tests/jestSetup.js'],
-       resetMocks: false,
-       collectCoverageFrom: [
-               '<rootDir>/apps/*/src/**/*.{js,vue}',
-       ],
-
-       testEnvironment: 'jest-environment-jsdom',
-
-       moduleFileExtensions: [
-               'js',
-               'vue',
-       ],
-
-       transform: {
-               // process `*.js` files with `babel-jest`
-               '.*\\.(js)$': 'babel-jest',
-               '^.+\\.vue$': '@vue/vue2-jest',
-       },
-}
diff --git a/jest.config.ts b/jest.config.ts
new file mode 100644 (file)
index 0000000..3743203
--- /dev/null
@@ -0,0 +1,70 @@
+/**
+ * @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@pm.me>
+ *
+ * @author Marco Ambrosini <marcoambrosini@pm.me>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+import type { Config } from 'jest'
+
+// TODO: find a way to consolidate this in one place, with webpack.common.js
+const ignorePatterns = [
+       '@juliushaertl',
+       '@mdi/svg',
+       '@nextcloud/vue',
+       'ansi-regex',
+       'char-regex',
+       'splitpanes',
+       'string-length',
+       'strip-ansi',
+       'tributejs',
+       'vue-material-design-icons',
+]
+
+const config: Config = {
+       testMatch: ['<rootDir>/**/*.(spec|test).(ts|js)'],
+       modulePathIgnorePatterns: [
+               '<rootDir>/apps2/',
+               '<rootDir>/apps-extra/',
+       ],
+       transformIgnorePatterns: [
+               'node_modules/(?!(' + ignorePatterns.join('|') + ')/)',
+       ],
+       clearMocks: true,
+       collectCoverageFrom: [
+               '<rootDir>/**/*.{js,vue}',
+       ],
+
+       setupFilesAfterEnv: ['<rootDir>/__tests__/jest-setup.ts'],
+
+       testEnvironment: 'jest-environment-jsdom',
+       preset: 'ts-jest/presets/js-with-ts',
+
+       // Allow mocking svg files
+       moduleDirectories: ['node_modules', '<rootDir>/'],
+       moduleNameMapper: {
+               '^.+\\.svg(\\?raw)?$': '<rootDir>/__mocks__/svg.js',
+       },
+
+       transform: {
+               // process `*.js` files with `babel-jest`
+               '^.+\\.js$': 'babel-jest',
+               '^.+\\.vue$': '@vue/vue2-jest',
+       },
+}
+
+export default config
index 413174b1e53cbd4c45c785f40cf4dc69031bd653..bfe848e1acd7f03761bf3868a8a4b8e9445369c1 100644 (file)
         "jest": "^29.0.3",
         "jest-environment-jsdom": "^29.5.0",
         "jsdoc": "^4.0.2",
-        "jsdom": "^22.0.0",
         "karma": "^6.4.2",
         "karma-chrome-launcher": "^3.1.1",
         "karma-coverage": "2.2.0",
         "sinon": "<= 5.0.7",
         "style-loader": "^3.3.1",
         "tar": "^6.1.15",
+        "ts-jest": "^29.1.0",
         "ts-loader": "^9.4.2",
         "ts-node": "^10.9.1",
         "tslib": "^2.5.3",
       "version": "1.0.0",
       "license": "ISC"
     },
+    "node_modules/bs-logger": {
+      "version": "0.2.6",
+      "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
+      "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
+      "dev": true,
+      "dependencies": {
+        "fast-json-stable-stringify": "2.x"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
     "node_modules/bser": {
       "version": "2.1.1",
       "dev": true,
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/cssstyle": {
-      "version": "3.0.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "rrweb-cssom": "^0.6.0"
-      },
-      "engines": {
-        "node": ">=14"
-      }
-    },
     "node_modules/csstype": {
       "version": "3.1.2",
       "license": "MIT"
         "node": ">= 12"
       }
     },
-    "node_modules/data-urls": {
-      "version": "4.0.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "abab": "^2.0.6",
-        "whatwg-mimetype": "^3.0.0",
-        "whatwg-url": "^12.0.0"
-      },
-      "engines": {
-        "node": ">=14"
-      }
-    },
     "node_modules/date-format": {
       "version": "4.0.14",
       "dev": true,
         "node": ">= 12"
       }
     },
-    "node_modules/jsdom": {
-      "version": "22.0.0",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "abab": "^2.0.6",
-        "cssstyle": "^3.0.0",
-        "data-urls": "^4.0.0",
-        "decimal.js": "^10.4.3",
-        "domexception": "^4.0.0",
-        "form-data": "^4.0.0",
-        "html-encoding-sniffer": "^3.0.0",
-        "http-proxy-agent": "^5.0.0",
-        "https-proxy-agent": "^5.0.1",
-        "is-potential-custom-element-name": "^1.0.1",
-        "nwsapi": "^2.2.4",
-        "parse5": "^7.1.2",
-        "rrweb-cssom": "^0.6.0",
-        "saxes": "^6.0.0",
-        "symbol-tree": "^3.2.4",
-        "tough-cookie": "^4.1.2",
-        "w3c-xmlserializer": "^4.0.0",
-        "webidl-conversions": "^7.0.0",
-        "whatwg-encoding": "^2.0.0",
-        "whatwg-mimetype": "^3.0.0",
-        "whatwg-url": "^12.0.1",
-        "ws": "^8.13.0",
-        "xml-name-validator": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=16"
-      },
-      "peerDependencies": {
-        "canvas": "^2.5.0"
-      },
-      "peerDependenciesMeta": {
-        "canvas": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/jsdom/node_modules/punycode": {
-      "version": "2.3.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/jsdom/node_modules/tough-cookie": {
-      "version": "4.1.2",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "psl": "^1.1.33",
-        "punycode": "^2.1.1",
-        "universalify": "^0.2.0",
-        "url-parse": "^1.5.3"
-      },
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/jsdom/node_modules/universalify": {
-      "version": "0.2.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 4.0.0"
-      }
-    },
     "node_modules/jsesc": {
       "version": "2.5.2",
       "dev": true,
         "node": ">=8"
       }
     },
-    "node_modules/rrweb-cssom": {
-      "version": "0.6.0",
-      "dev": true,
-      "license": "MIT"
-    },
     "node_modules/run-parallel": {
       "version": "1.2.0",
       "dev": true,
         "node": ">=6"
       }
     },
-    "node_modules/tr46": {
-      "version": "4.1.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "punycode": "^2.3.0"
-      },
-      "engines": {
-        "node": ">=14"
-      }
-    },
-    "node_modules/tr46/node_modules/punycode": {
-      "version": "2.3.0",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6"
-      }
-    },
     "node_modules/tributejs": {
       "version": "5.1.3",
       "license": "MIT"
         "url": "https://github.com/sponsors/wooorm"
       }
     },
+    "node_modules/ts-jest": {
+      "version": "29.1.0",
+      "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz",
+      "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==",
+      "dev": true,
+      "dependencies": {
+        "bs-logger": "0.x",
+        "fast-json-stable-stringify": "2.x",
+        "jest-util": "^29.0.0",
+        "json5": "^2.2.3",
+        "lodash.memoize": "4.x",
+        "make-error": "1.x",
+        "semver": "7.x",
+        "yargs-parser": "^21.0.1"
+      },
+      "bin": {
+        "ts-jest": "cli.js"
+      },
+      "engines": {
+        "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+      },
+      "peerDependencies": {
+        "@babel/core": ">=7.0.0-beta.0 <8",
+        "@jest/types": "^29.0.0",
+        "babel-jest": "^29.0.0",
+        "jest": "^29.0.0",
+        "typescript": ">=4.3 <6"
+      },
+      "peerDependenciesMeta": {
+        "@babel/core": {
+          "optional": true
+        },
+        "@jest/types": {
+          "optional": true
+        },
+        "babel-jest": {
+          "optional": true
+        },
+        "esbuild": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/ts-jest/node_modules/lodash.memoize": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
+      "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",
+      "dev": true
+    },
+    "node_modules/ts-jest/node_modules/lru-cache": {
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+      "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+      "dev": true,
+      "dependencies": {
+        "yallist": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/ts-jest/node_modules/semver": {
+      "version": "7.5.2",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
+      "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
+      "dev": true,
+      "dependencies": {
+        "lru-cache": "^6.0.0"
+      },
+      "bin": {
+        "semver": "bin/semver.js"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/ts-jest/node_modules/yallist": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+      "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+      "dev": true
+    },
+    "node_modules/ts-jest/node_modules/yargs-parser": {
+      "version": "21.1.1",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+      "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+      "dev": true,
+      "engines": {
+        "node": ">=12"
+      }
+    },
     "node_modules/ts-loader": {
       "version": "9.4.2",
       "dev": true,
         "node": ">=12"
       }
     },
-    "node_modules/whatwg-url": {
-      "version": "12.0.1",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "tr46": "^4.1.1",
-        "webidl-conversions": "^7.0.0"
-      },
-      "engines": {
-        "node": ">=14"
-      }
-    },
     "node_modules/which": {
       "version": "2.0.2",
       "dev": true,
         }
       }
     },
+    "bs-logger": {
+      "version": "0.2.6",
+      "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
+      "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
+      "dev": true,
+      "requires": {
+        "fast-json-stable-stringify": "2.x"
+      }
+    },
     "bser": {
       "version": "2.1.1",
       "dev": true,
       "version": "0.5.0",
       "dev": true
     },
-    "cssstyle": {
-      "version": "3.0.0",
-      "dev": true,
-      "requires": {
-        "rrweb-cssom": "^0.6.0"
-      }
-    },
     "csstype": {
       "version": "3.1.2"
     },
       "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
       "optional": true
     },
-    "data-urls": {
-      "version": "4.0.0",
-      "dev": true,
-      "requires": {
-        "abab": "^2.0.6",
-        "whatwg-mimetype": "^3.0.0",
-        "whatwg-url": "^12.0.0"
-      }
-    },
     "date-format": {
       "version": "4.0.14",
       "dev": true
       "dev": true,
       "peer": true
     },
-    "jsdom": {
-      "version": "22.0.0",
-      "dev": true,
-      "requires": {
-        "abab": "^2.0.6",
-        "cssstyle": "^3.0.0",
-        "data-urls": "^4.0.0",
-        "decimal.js": "^10.4.3",
-        "domexception": "^4.0.0",
-        "form-data": "^4.0.0",
-        "html-encoding-sniffer": "^3.0.0",
-        "http-proxy-agent": "^5.0.0",
-        "https-proxy-agent": "^5.0.1",
-        "is-potential-custom-element-name": "^1.0.1",
-        "nwsapi": "^2.2.4",
-        "parse5": "^7.1.2",
-        "rrweb-cssom": "^0.6.0",
-        "saxes": "^6.0.0",
-        "symbol-tree": "^3.2.4",
-        "tough-cookie": "^4.1.2",
-        "w3c-xmlserializer": "^4.0.0",
-        "webidl-conversions": "^7.0.0",
-        "whatwg-encoding": "^2.0.0",
-        "whatwg-mimetype": "^3.0.0",
-        "whatwg-url": "^12.0.1",
-        "ws": "^8.13.0",
-        "xml-name-validator": "^4.0.0"
-      },
-      "dependencies": {
-        "punycode": {
-          "version": "2.3.0",
-          "dev": true
-        },
-        "tough-cookie": {
-          "version": "4.1.2",
-          "dev": true,
-          "requires": {
-            "psl": "^1.1.33",
-            "punycode": "^2.1.1",
-            "universalify": "^0.2.0",
-            "url-parse": "^1.5.3"
-          }
-        },
-        "universalify": {
-          "version": "0.2.0",
-          "dev": true
-        }
-      }
-    },
     "jsesc": {
       "version": "2.5.2",
       "dev": true
         }
       }
     },
-    "rrweb-cssom": {
-      "version": "0.6.0",
-      "dev": true
-    },
     "run-parallel": {
       "version": "1.2.0",
       "dev": true,
         }
       }
     },
-    "tr46": {
-      "version": "4.1.1",
-      "dev": true,
-      "requires": {
-        "punycode": "^2.3.0"
-      },
-      "dependencies": {
-        "punycode": {
-          "version": "2.3.0",
-          "dev": true
-        }
-      }
-    },
     "tributejs": {
       "version": "5.1.3"
     },
     "trough": {
       "version": "2.1.0"
     },
+    "ts-jest": {
+      "version": "29.1.0",
+      "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz",
+      "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==",
+      "dev": true,
+      "requires": {
+        "bs-logger": "0.x",
+        "fast-json-stable-stringify": "2.x",
+        "jest-util": "^29.0.0",
+        "json5": "^2.2.3",
+        "lodash.memoize": "4.x",
+        "make-error": "1.x",
+        "semver": "7.x",
+        "yargs-parser": "^21.0.1"
+      },
+      "dependencies": {
+        "lodash.memoize": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
+          "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",
+          "dev": true
+        },
+        "lru-cache": {
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+          "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+          "dev": true,
+          "requires": {
+            "yallist": "^4.0.0"
+          }
+        },
+        "semver": {
+          "version": "7.5.2",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
+          "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^6.0.0"
+          }
+        },
+        "yallist": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+          "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+          "dev": true
+        },
+        "yargs-parser": {
+          "version": "21.1.1",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+          "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+          "dev": true
+        }
+      }
+    },
     "ts-loader": {
       "version": "9.4.2",
       "dev": true,
       "version": "3.0.0",
       "dev": true
     },
-    "whatwg-url": {
-      "version": "12.0.1",
-      "dev": true,
-      "requires": {
-        "tr46": "^4.1.1",
-        "webidl-conversions": "^7.0.0"
-      }
-    },
     "which": {
       "version": "2.0.2",
       "dev": true,
index e96e0fba95c1d671d487af2e16df920d4750d4b7..5f729f0fddf34fd1039f9703a540946aee96d950 100644 (file)
     "jest": "^29.0.3",
     "jest-environment-jsdom": "^29.5.0",
     "jsdoc": "^4.0.2",
-    "jsdom": "^22.0.0",
     "karma": "^6.4.2",
     "karma-chrome-launcher": "^3.1.1",
     "karma-coverage": "2.2.0",
     "sinon": "<= 5.0.7",
     "style-loader": "^3.3.1",
     "tar": "^6.1.15",
+    "ts-jest": "^29.1.0",
     "ts-loader": "^9.4.2",
     "ts-node": "^10.9.1",
     "tslib": "^2.5.3",
diff --git a/tests/jestSetup.js b/tests/jestSetup.js
deleted file mode 100644 (file)
index c0813ff..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * @copyright 2021 François Freitag <mail@franek.fr>
- *
- * @author François Freitag <mail@franek.fr>
- *
- * @license AGPL-3.0-or-later
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-import '@testing-library/jest-dom'