Skip to content

Commit

Permalink
chore: replace to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 24, 2024
1 parent 8320bf3 commit f0204cb
Show file tree
Hide file tree
Showing 5 changed files with 1,290 additions and 733 deletions.
26 changes: 26 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Config } from 'jest';

const config: Config = {
verbose: true,
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'md'],
testPathIgnorePatterns: ['/node_modules/'],
testRegex: '.*\\.test\\.(j|t)sx?$',
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*/__tests__/*.{ts,tsx}',
'!src/**/*/types.{ts,tsx}',
],
moduleNameMapper: {
'\\.css$': 'identity-obj-proxy',
},
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
testEnvironmentOptions: {
url: 'http://localhost',
},
};

export default config;
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "father build",
"build:site": "storybook build",
"prepare": "is-ci || husky install",
"test": "vitest",
"test": "jest",
"tsc:check": "tsc --noEmit"
},
"keywords": [
Expand Down Expand Up @@ -70,6 +70,8 @@
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/geojson": "^7946.0.13",
"@types/jest": "^29.5.11",
"@types/jsdom": "^21.1.6",
"@types/lodash-es": "^4.17.12",
"@types/mapbox-gl": "^2.7.19",
"@types/react": "^18.2.21",
Expand All @@ -78,7 +80,10 @@
"antd": "^5.13.1",
"father": "^4.3.8",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"is-ci": "^3.0.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^23.2.0",
"lint-staged": "^15.2.0",
"mapbox-gl": "^3.1.0",
Expand All @@ -87,10 +92,8 @@
"react-dom": "^18.2.0",
"semantic-release": "^23.0.0",
"storybook": "^7.6.8",
"typescript": "^5.3.3",
"vite": "^5.0.11",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.2.1"
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"lint-staged": {
"*.{jsx,less,md,json}": [
Expand Down
Loading

0 comments on commit f0204cb

Please sign in to comment.