feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722)

Due to the pattern `**/specs/*.spec.js` defined in CircleCI, none of the
frontend spec in the folders such as
`specs/<domain-name>/getters.spec.js` were not executed in Circle CI.

This PR fixes the issue, along with the following changes: 
- Use vitest instead of jest
- Remove jest dependancies
- Update tests to work with vitest

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Pranav
2024-07-10 08:32:16 -07:00
committed by GitHub
parent 9498d1f003
commit 9de8c27368
140 changed files with 1678 additions and 2810 deletions

View File

@@ -5,10 +5,9 @@
"scripts": {
"eslint": "eslint app/**/*.{js,vue}",
"eslint:fix": "eslint app/**/*.{js,vue} --fix",
"pretest": "rimraf .jest-cache",
"test": "jest -w 1 --no-cache --no-coverage",
"test:watch": "jest -w 1 --watch --no-cache",
"test:coverage": "jest -w 1 --no-cache --collectCoverage",
"test": "TZ=UTC vitest --no-watch --no-cache --no-coverage",
"test:watch": "TZ=UTC vitest --no-cache --no-coverage",
"test:coverage": "TZ=UTC vitest --no-cache --no-watch --coverage",
"webpacker-start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors",
"start:dev": "foreman start -f ./Procfile.dev",
"start:test": "RAILS_ENV=test foreman start -f ./Procfile.test",
@@ -118,12 +117,11 @@
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addons": "6.5.9",
"@storybook/vue": "6.5.9",
"@types/jest": "^29.5.2",
"@vitejs/plugin-vue2": "^2.3.1",
"@vitest/coverage-v8": "^2.0.1",
"@vue/test-utils": "^1.3.6",
"@vue/vue2-jest": "29",
"babel-core": "^7.0.0-bridge.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "29",
"babel-loader": "8.2.2",
"babel-preset-vue": "^2.0.2",
"cypress": "^13.4.0",
@@ -139,18 +137,15 @@
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-storybook": "^0.6.14",
"eslint-plugin-vue": "^9.17.0",
"expect-more-jest": "^2.4.2",
"fake-indexeddb": "^4.0.1",
"fake-indexeddb": "^6.0.0",
"husky": "^7.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^2.0.0",
"jsdom": "^24.1.0",
"lint-staged": "14.0.1",
"postcss-preset-env": "^8.5.1",
"prettier": "^3.0.3",
"rimraf": "^3.0.0",
"size-limit": "^8.2.4",
"vitest": "^2.0.1",
"webpack-dev-server": "^3"
},
"engines": {