Skip to content

Commit 1eee24d

Browse files
committed
♻️(docs-app) Switch from Jest tests to Vitest
We have migrated the testing framework from Jest to Vitest for the Docs application. This change includes updates to test files, configuration files, and the addition of new setup files for Vitest.
1 parent ff9e13c commit 1eee24d

File tree

29 files changed

+323
-275
lines changed

29 files changed

+323
-275
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to
1414

1515
### Changed
1616

17+
- ♻️(docs-app) Switch from Jest tests to Vitest #1269
1718
- ⚡️(frontend) improve accessibility:
1819
- #1248
1920
- #1235

src/frontend/apps/impress/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
NEXT_PUBLIC_API_ORIGIN=http://test.jest
2+
NEXT_PUBLIC_PUBLISH_AS_MIT=false

src/frontend/apps/impress/jest.config.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/frontend/apps/impress/jest.setup.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/frontend/apps/impress/jest/mocks/ComponentMock.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/frontend/apps/impress/jest/mocks/fileMock.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/frontend/apps/impress/jest/mocks/svg.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/frontend/apps/impress/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"lint": "tsc --noEmit && next lint",
1212
"prettier": "prettier --write .",
1313
"stylelint": "stylelint \"**/*.css\"",
14-
"test": "jest",
15-
"test:watch": "jest --watch"
14+
"test": "vitest",
15+
"test:watch": "vitest --watch"
1616
},
1717
"dependencies": {
1818
"@ag-media/react-pdf-table": "2.0.3",
@@ -67,24 +67,25 @@
6767
"@testing-library/jest-dom": "6.6.4",
6868
"@testing-library/react": "16.3.0",
6969
"@testing-library/user-event": "14.6.1",
70-
"@types/jest": "30.0.0",
7170
"@types/lodash": "4.17.20",
7271
"@types/luxon": "3.7.1",
7372
"@types/node": "*",
7473
"@types/react": "*",
7574
"@types/react-dom": "*",
75+
"@vitejs/plugin-react": "4.7.0",
7676
"cross-env": "10.0.0",
7777
"dotenv": "17.2.1",
7878
"eslint-config-impress": "*",
7979
"fetch-mock": "9.11.0",
80-
"jest": "30.0.5",
81-
"jest-environment-jsdom": "30.0.5",
80+
"jsdom": "26.1.0",
8281
"node-fetch": "2.7.0",
8382
"prettier": "3.6.2",
8483
"stylelint": "16.23.0",
8584
"stylelint-config-standard": "39.0.0",
8685
"stylelint-prettier": "5.0.3",
8786
"typescript": "*",
87+
"vite-tsconfig-paths": "5.1.4",
88+
"vitest": "3.2.4",
8889
"webpack": "5.101.0",
8990
"workbox-webpack-plugin": "7.1.0"
9091
}

src/frontend/apps/impress/src/api/__tests__/APIError.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from 'vitest';
2+
13
import { APIError, isAPIError } from '@/api';
24

35
describe('APIError', () => {

src/frontend/apps/impress/src/api/__tests__/config.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, expect, it } from 'vitest';
2+
13
import { baseApiUrl } from '@/api';
24

35
describe('config', () => {

0 commit comments

Comments
 (0)