test: working test with TypeScript + vite (using vitest)

This commit is contained in:
鲁树人
2023-05-17 01:46:20 +01:00
parent 863a4e4f89
commit 0db84813ad
19 changed files with 687 additions and 75 deletions

View File

@@ -8,8 +8,11 @@
"build": "tsc -p tsconfig.prod.json && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier -w .",
"test": "NODE_ENV=test jest",
"preview": "vite preview"
"test": "vitest run",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"preview": "vite preview",
"preview:coverage": "vite preview --outDir coverage --port 5175"
},
"dependencies": {
"@chakra-ui/icons": "^2.0.19",
@@ -40,20 +43,24 @@
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"@vitejs/plugin-react": "^4.0.0",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/ui": "^0.31.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.8",
"typescript": "^5.0.2",
"vite": "^4.3.2",
"vite-plugin-top-level-await": "^1.3.0",
"vite-plugin-wasm": "^3.2.2"
"vite-plugin-wasm": "^3.2.2",
"vitest": "^0.31.0"
},
"prettier": {
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
}
}
}