Skip to content

Commit 28da9f3

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 409e073 commit 28da9f3

File tree

28 files changed

+345
-303
lines changed

28 files changed

+345
-303
lines changed

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.3",
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.6.2",
7372
"@types/node": "*",
7473
"@types/react": "*",
7574
"@types/react-dom": "*",
75+
"@vitejs/plugin-react": "4.7.0",
7676
"cross-env": "7.0.3",
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.22.0",
8584
"stylelint-config-standard": "38.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.100.2",
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', () => {

src/frontend/apps/impress/src/api/__tests__/fetchApi.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fetchMock from 'fetch-mock';
2+
import { beforeEach, describe, expect, it } from 'vitest';
23

34
import { fetchAPI } from '@/api';
45

0 commit comments

Comments
 (0)