chore: fix and migrate unit tests to vitest

This commit is contained in:
Christian Andolf
2025-06-27 13:35:41 +02:00
parent a91c28096d
commit ff40ef72c4
26 changed files with 818 additions and 2835 deletions

View File

@@ -15,8 +15,8 @@
"test:e2e:headless": "start-server-and-test test:setup http://127.0.0.1:3000/en/sponsoring \"cypress run --e2e\"",
"test:setup": "yarn build && yarn start",
"preinstall": "/bin/sh -c \"export $(cat .env.local | grep -v '^#' | xargs)\"",
"test": "node --experimental-vm-modules $(yarn bin jest)",
"test:watch": "node --experimental-vm-modules $(yarn bin jest) --watch",
"test": "vitest run",
"test:watch": "vitest",
"ci:build": "yarn lint && yarn test && yarn build",
"clean": "rm -rf .next",
"i18n:extract": "formatjs extract \"{actions,app,components,constants,contexts,env,hooks,i18n,lib,middlewares,netlify,providers,server,services,stores,utils}/**/*.{ts,tsx}\" --format i18n/tooling/formatter.mjs --out-file i18n/tooling/extracted.json",
@@ -120,14 +120,13 @@
"@eslint/js": "^9.26.0",
"@formatjs/cli": "^6.7.1",
"@lokalise/node-api": "^14.0.0",
"@react-aria/test-utils": "1.0.0-alpha.8",
"@scandic-hotels/common": "workspace:*",
"@scandic-hotels/typescript-config": "workspace:*",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/adm-zip": "^0.5.7",
"@types/jest": "^29.5.14",
"@types/json-stable-stringify-without-jsonify": "^1.0.2",
"@types/jsonwebtoken": "^9",
"@types/lodash-es": "^4",
@@ -136,7 +135,9 @@
"@types/react-dom": "19.1.0",
"@typescript-eslint/eslint-plugin": "^8.32.0",
"@typescript-eslint/parser": "^8.32.0",
"@vitejs/plugin-react": "^4.6.0",
"adm-zip": "^0.5.16",
"babel-plugin-formatjs": "^10.5.39",
"cypress": "^14.3.3",
"dotenv": "^16.5.0",
"eslint": "^9",
@@ -144,20 +145,20 @@
"eslint-plugin-formatjs": "^5.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jiti": "^1.21.0",
"jsdom": "^26.1.0",
"json-sort-cli": "^4.0.9",
"lint-staged": "^15.5.2",
"netlify-plugin-cypress": "^2.2.1",
"prettier": "^3.5.3",
"schema-dts": "^1.1.5",
"start-server-and-test": "^2.0.11",
"ts-jest": "^29.3.2",
"ts-morph": "^25.0.1",
"ts-node": "^10.9.2",
"typescript": "5.8.3",
"typescript-plugin-css-modules": "^5.1.0"
"typescript-plugin-css-modules": "^5.1.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4"
},
"engines": {
"node": "22"