Skip to content

Commit

Permalink
feat-412: move from jest to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Füting committed Dec 3, 2024
1 parent d99accf commit 123cab8
Show file tree
Hide file tree
Showing 15 changed files with 979 additions and 766 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ web/.json-autotranslate-cache
/.idea

# nextjs builds
web/.next
web/.next

# test coverage
.coverage
35 changes: 0 additions & 35 deletions web/config/jest/jest.config.js

This file was deleted.

33 changes: 0 additions & 33 deletions web/config/jest/jest.eslint.config.js

This file was deleted.

53 changes: 0 additions & 53 deletions web/config/jest/jest.tests.config.js

This file was deleted.

1 change: 0 additions & 1 deletion web/config/jest/mocks/fileMock.js

This file was deleted.

11 changes: 0 additions & 11 deletions web/config/jest/mocks/mockPopperJS.js

This file was deleted.

3 changes: 0 additions & 3 deletions web/config/jest/mocks/mockReactChildrenUtilities.js

This file was deleted.

3 changes: 0 additions & 3 deletions web/config/jest/mocks/mockUseDebounce.js

This file was deleted.

1 change: 0 additions & 1 deletion web/config/jest/setupDotenv.js

This file was deleted.

17 changes: 9 additions & 8 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@
"stylelint:fix:watch": "nodemon --config config/nodemon/stylelint.fix.json",
"format": "prettier --check \"**/*.{js,jsx,ts,tsx,json,html,css,less,scss,yml,yaml}\"",
"format:fix": "yarn format --write",
"test": "yarn test:nowatch --watch --verbose ",
"test:nowatch": "jest --config=config/jest/jest.config.js --passWithNoTests",
"test:lint": "WITH_ESLINT=1 yarn test",
"test:lint:nowatch": "WITH_ESLINT=1 yarn test:nowatch",
"test:debug": "node --inspect-brk node_modules/.bin/jest --config=config/jest/jest.config.js --runInBand --watch",
"test:coverage": "yarn test:nowatch --coverage",
"test": "yarn vitest",
"test:nowatch": "vitest run",
"test:coverage": "yarn vitest --coverage",
"run:node": "cross-env NODE_ENV=development BABEL_ENV=development babel-node --config-file \"./babel-node.config.js\" --extensions '.ts'",
"run:node:prod": "cross-env NODE_ENV=production BABEL_ENV=production babel-node --config-file \"./babel-node.config.js\" --extensions '.ts'",
"monkey-patch": "yarn run:node tools/monkeyPatch.ts",
Expand Down Expand Up @@ -165,7 +162,6 @@
"@types/friendly-errors-webpack-plugin": "^1.7.0",
"@types/fs-extra": "^11.0.4",
"@types/history": "^5.0.0",
"@types/jest": "^29.5.14",
"@types/jest-axe": "^3.5.9",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.17.13",
Expand All @@ -192,6 +188,8 @@
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"@typescript-eslint/typescript-estree": "^8.15.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "2.1.8",
"allow-methods": "^6.2.1",
"babel-jest": "^27.0.1",
"babel-plugin-parameter-decorator": "^1.0.16",
Expand Down Expand Up @@ -249,9 +247,9 @@
"i18next-parser": "^9.0.2",
"identity-obj-proxy": "^3.0.0",
"is-interactive": "^2.0.0",
"jest": "^29.7.0",
"jest-axe": "^9.0.0",
"jest-chain": "^1.1.6",
"jest-environment-jsdom": "^29.7.0",
"jest-extended": "^4.0.2",
"jest-raw-loader": "^1.0.1",
"jest-runner-eslint": "^2.2.1",
Expand Down Expand Up @@ -286,10 +284,13 @@
"style-loader": "^4.0.0",
"svgo": "^3.3.2",
"ts-essentials": "^10.0.3",
"ts-node": "^10.9.2",
"ts-toolbelt": "^9.6.0",
"typescript": "^5.6.3",
"url-loader": "^4.1.1",
"utility-types": "^3.11.0",
"vite-tsconfig-paths": "^5.1.3",
"vitest": "^2.1.8",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4",
"webpackbar": "^7.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { parseAminoacidMutation } from 'src/components/Common/parseAminoacidMutation'
import { describe, it, expect } from 'vitest'

describe('parseAminoacidMutation', () => {
it('should parse gene, ref, position, right', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { parseNucleotideMutation } from 'src/components/Common/parseNucleotideMutation'
import { describe, it, expect } from 'vitest'

describe('parseNucleotideMutation', () => {
it('should parse left, position, right', () => {
Expand Down
1 change: 1 addition & 0 deletions web/src/components/Common/__tests__/parseVariant.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { parseVariant } from 'src/components/Common/parseVariant'
import { describe, it, expect } from 'vitest'

describe('parseVariant', () => {
it('should accept "20A.EU2"', async () => {
Expand Down
14 changes: 14 additions & 0 deletions web/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: 'jsdom',
coverage: {
provider: 'v8',
reportsDirectory: '.coverage',
},
},
})
Loading

0 comments on commit 123cab8

Please sign in to comment.