chore(web): migrate to vitest (#5754)

* Updated vite and ts config file with vtest options and a new alias to fix the dev command error

* Updated package script and update the packages
 -- this removes jest dependencies

* Added new setup file needed in vitest in order to be able to use the jest-dom matchers in tests

* Updated deprecated utilities when using faker

* Updated test files and mocks to use vitest instead of jest

* Enabled web test check in GitHub actions

* remove babel dependencies as they are no longer needed with vitest

* move the jest config files to a folder in case we need to go back to jest

* chore: remove old files

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Jorge Avila
2024-01-01 10:36:49 -07:00
committed by GitHub
parent 9de557916b
commit 5f6d09d3da
18 changed files with 2227 additions and 6080 deletions
+7 -11
View File
@@ -15,19 +15,17 @@
"lint:fix": "npm run lint -- --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"test": "jest",
"test:cov": "jest --coverage",
"test:watch": "npm test -- --watch",
"test": "vitest --run",
"test:cov": "vitest --coverage",
"test:watch": "vitest dev",
"prepare": "svelte-kit sync"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.22.5",
"@faker-js/faker": "^8.0.0",
"@floating-ui/dom": "^1.5.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/svelte": "^4.0.3",
"@types/dom-to-image": "^2.6.4",
"@types/justified-layout": "^4.1.0",
@@ -35,26 +33,24 @@
"@types/luxon": "^3.2.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitest/coverage-v8": "^1.0.4",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.4.3",
"eslint": "^8.34.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.30.0",
"factory.ts": "^1.3.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.4.3",
"jest-environment-jsdom": "^29.4.3",
"postcss": "^8.4.21",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
"svelte-jester": "^3.0.0",
"svelte-preprocess": "^5.0.3",
"tailwindcss": "^3.2.7",
"tslib": "^2.5.0",
"typescript": "^5.0.0",
"vite": "^4.1.4"
"vite": "^4.1.4",
"vitest": "^1.0.4"
},
"type": "module",
"dependencies": {