Skip to content

Commit ea4f228

Browse files
committedMar 12, 2025·
chore: replaced jest with vitest
1 parent b4a3fcb commit ea4f228

8 files changed

+694
-1495
lines changed
 

‎.eslintrc

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"extends": [
2222
"eslint:recommended",
23-
"plugin:jest-formatting/recommended",
2423
"plugin:@typescript-eslint/eslint-recommended",
2524
"plugin:@typescript-eslint/recommended",
2625
"plugin:react/recommended",
@@ -30,7 +29,6 @@
3029
//"plugin:prettier/recommended" // Make this the last element so prettier config overrides other formatting rules
3130
],
3231
"plugins": [
33-
"jest-formatting",
3432
"simple-import-sort",
3533
"import",
3634
"react-hooks",

‎jest-setup.ts

-25
This file was deleted.

‎package.json

+3-14
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"lint:fix": "eslint --fix .",
1212
"lint:check": "eslint .",
1313
"preview": "vite preview",
14-
"test": "NODE_ENV=test jest --runInBand",
15-
"test:updateSnapshot": "NODE_ENV=test jest --updateSnapshot",
16-
"test:coverage": "NODE_ENV=test jest --coverage",
14+
"test": "NODE_ENV=test vitest run",
1715
"prepare": "husky || true",
1816
"pre-commit": "lint-staged",
1917
"vis": "yarn vite-bundle-visualizer",
@@ -61,9 +59,6 @@
6159
"@commitlint/config-conventional": "^17.6.7",
6260
"@sentry/vite-plugin": "^0.7.2",
6361
"@tailwindcss/typography": "^0.5.15",
64-
"@testing-library/jest-dom": "^6.1.5",
65-
"@testing-library/react": "^14.1.2",
66-
"@testing-library/user-event": "^14.5.1",
6762
"@types/eslint": "^8.4.10",
6863
"@types/file-saver": "^2.0.7",
6964
"@types/jest": "^29.5.10",
@@ -77,12 +72,10 @@
7772
"@vitejs/plugin-react": "^4.2.1",
7873
"@vitejs/plugin-react-swc": "^3.5.0",
7974
"autoprefixer": "^10.4.17",
80-
"babel-jest": "^29.7.0",
8175
"core-js": "^3.36.0",
8276
"eslint": "^8.56.0",
8377
"eslint-config-prettier": "^8.5.0",
8478
"eslint-plugin-import": "^2.26.0",
85-
"eslint-plugin-jest-formatting": "^3.1.0",
8679
"eslint-plugin-jsx-a11y": "^6.6.1",
8780
"eslint-plugin-jsx-no-inline-style": "^0.0.5",
8881
"eslint-plugin-prettier": "^4.2.1",
@@ -92,10 +85,6 @@
9285
"eslint-plugin-simple-import-sort": "^8.0.0",
9386
"eslint-plugin-tailwindcss": "^3.14.2",
9487
"husky": "^9.0.11",
95-
"jest": "^29.7.0",
96-
"jest-environment-jsdom": "^29.7.0",
97-
"jest-location-mock": "^2.0.0",
98-
"jest-transform-stub": "^2.0.0",
9988
"lint-staged": "^15.2.2",
10089
"lodash": "^4.17.21",
10190
"nyc": "^15.1.0",
@@ -108,13 +97,13 @@
10897
"tailwind-scrollbar": "^3.1.0",
10998
"tailwindcss": "^3.4.1",
11099
"tailwindcss-animate": "^1.0.7",
111-
"ts-jest": "^29.2.5",
112100
"ts-node": "^10.9.2",
113101
"typescript": "^5.6.3",
114102
"vite": "^5.1.0",
115103
"vite-bundle-visualizer": "^1.0.1",
116104
"vite-plugin-node-polyfills": "^0.21.0",
117-
"vite-plugin-svgr": "^4.2.0"
105+
"vite-plugin-svgr": "^4.2.0",
106+
"vitest": "^3.0.8"
118107
},
119108
"lint-staged": {
120109
"{lib,packages}/**/src/**/*.{ts,tsx}": [

‎tests/App.test.tsx

-10
This file was deleted.

‎tests/__snapshots__/App.test.tsx.snap

-74
This file was deleted.

‎vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference types="vitest/config" />
12
import { sentryVitePlugin } from '@sentry/vite-plugin';
23
import react from '@vitejs/plugin-react';
34
import path from 'path';

‎vitest.config.ts

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/// <reference types="vitest/config" />
2+
import { sentryVitePlugin } from '@sentry/vite-plugin';
3+
import react from '@vitejs/plugin-react';
4+
import path from 'path';
5+
import { defineConfig } from 'vite';
6+
import { nodePolyfills } from 'vite-plugin-node-polyfills';
7+
import svgr from 'vite-plugin-svgr';
8+
9+
// https://vitejs.dev/config/
10+
export default defineConfig({
11+
esbuild: false,
12+
build: {
13+
sourcemap: true,
14+
minify: true,
15+
cssMinify: true,
16+
},
17+
plugins: [
18+
svgr(),
19+
react(),
20+
nodePolyfills(),
21+
...(process.env.VITE_NODE_ENV
22+
? [
23+
sentryVitePlugin({
24+
org: process.env.VITE_SENTRY_ORG,
25+
project: process.env.VITE_SENTRY_PROJECT,
26+
ignore: ['node_modules', 'vite.config.ts'],
27+
authToken: process.env.VITE_SENTRY_AUTH_TOKEN,
28+
sourcemaps: {
29+
assets: './dist/**',
30+
},
31+
release: process.env.VITE_SENTRY_RELEASE,
32+
deploy: {
33+
env: process.env.VITE_NODE_ENV,
34+
},
35+
}),
36+
]
37+
: []),
38+
],
39+
base: '',
40+
test: {
41+
globals: true,
42+
},
43+
define: {
44+
"__NPM_PACKAGE_VERSION__": JSON.stringify(process.env.npm_package_version),
45+
'process.env': {
46+
// DO NOT EXPOSE THE ENTIRE process.env HERE - sensitive information on CI/CD could be exposed.
47+
// defining here as an empty object as there are errors otherwise
48+
},
49+
},
50+
resolve: {
51+
alias: {
52+
'@tests': path.resolve(__dirname) + '/tests',
53+
'@src': path.resolve(__dirname) + '/src',
54+
},
55+
},
56+
});

‎yarn.lock

+634-1,370
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.