chore: vitest support (#4026)
* chore: vitest * chore: move test files * chore: support vitest * fix: exclude test files * chore(ci): add test workflow * feat: remove read env
Showing
.github/workflows/fastgpt-test.yaml
0 → 100644
| ... | @@ -11,16 +11,22 @@ | ... | @@ -11,16 +11,22 @@ |
| "initIcon": "node ./scripts/icon/init.js", | "initIcon": "node ./scripts/icon/init.js", | ||
| "previewIcon": "node ./scripts/icon/index.js", | "previewIcon": "node ./scripts/icon/index.js", | ||
| "api:gen": "tsc ./scripts/openapi/index.ts && node ./scripts/openapi/index.js && npx @redocly/cli build-docs ./scripts/openapi/openapi.json -o ./projects/app/public/openapi/index.html", | "api:gen": "tsc ./scripts/openapi/index.ts && node ./scripts/openapi/index.js && npx @redocly/cli build-docs ./scripts/openapi/openapi.json -o ./projects/app/public/openapi/index.html", | ||
| "create:i18n": "node ./scripts/i18n/index.js" | "create:i18n": "node ./scripts/i18n/index.js", | ||
| "test": "vitest run --exclude './projects/app/src/test/**'", | |||
| "test:all": "vitest run", | |||
| "test:workflow": "vitest run workflow" | |||
| }, | }, | ||
| "devDependencies": { | "devDependencies": { | ||
| "@chakra-ui/cli": "^2.4.1", | "@chakra-ui/cli": "^2.4.1", | ||
| "@vitest/coverage-v8": "^3.0.2", | |||
| "husky": "^8.0.3", | "husky": "^8.0.3", | ||
| "lint-staged": "^13.3.0", | |||
| "i18next": "23.11.5", | "i18next": "23.11.5", | ||
| "lint-staged": "^13.3.0", | |||
| "next-i18next": "15.3.0", | "next-i18next": "15.3.0", | ||
| "react-i18next": "14.1.2", | |||
| "prettier": "3.2.4", | "prettier": "3.2.4", | ||
| "react-i18next": "14.1.2", | |||
| "vitest": "^3.0.2", | |||
| "vitest-mongodb": "^1.0.1", | |||
| "zhlint": "^0.7.4" | "zhlint": "^0.7.4" | ||
| }, | }, | ||
| "lint-staged": { | "lint-staged": { | ||
| ... | ... |
packages/service/test/utils.ts
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
projects/app/jest.config.js
deleted
100644 → 0
| ... | @@ -6,8 +6,7 @@ | ... | @@ -6,8 +6,7 @@ |
| "dev": "next dev", | "dev": "next dev", | ||
| "build": "next build", | "build": "next build", | ||
| "start": "next start", | "start": "next start", | ||
| "lint": "next lint", | "lint": "next lint" | ||
| "test": "jest" | |||
| }, | }, | ||
| "dependencies": { | "dependencies": { | ||
| "@chakra-ui/anatomy": "2.2.1", | "@chakra-ui/anatomy": "2.2.1", | ||
| ... | @@ -26,7 +25,6 @@ | ... | @@ -26,7 +25,6 @@ |
| "@fortaine/fetch-event-source": "^3.0.6", | "@fortaine/fetch-event-source": "^3.0.6", | ||
| "@node-rs/jieba": "1.10.0", | "@node-rs/jieba": "1.10.0", | ||
| "@tanstack/react-query": "^4.24.10", | "@tanstack/react-query": "^4.24.10", | ||
| "@types/jest": "^29.5.2", | |||
| "@types/nprogress": "^0.2.0", | "@types/nprogress": "^0.2.0", | ||
| "ahooks": "^3.7.11", | "ahooks": "^3.7.11", | ||
| "axios": "^1.8.2", | "axios": "^1.8.2", | ||
| ... | @@ -39,7 +37,6 @@ | ... | @@ -39,7 +37,6 @@ |
| "hyperdown": "^2.4.29", | "hyperdown": "^2.4.29", | ||
| "i18next": "23.11.5", | "i18next": "23.11.5", | ||
| "immer": "^9.0.19", | "immer": "^9.0.19", | ||
| "jest": "^29.5.0", | |||
| "js-yaml": "^4.1.0", | "js-yaml": "^4.1.0", | ||
| "json5": "^2.2.3", | "json5": "^2.2.3", | ||
| "jsondiffpatch": "^0.6.0", | "jsondiffpatch": "^0.6.0", | ||
| ... | @@ -69,13 +66,10 @@ | ... | @@ -69,13 +66,10 @@ |
| "remark-math": "^6.0.0", | "remark-math": "^6.0.0", | ||
| "request-ip": "^3.3.0", | "request-ip": "^3.3.0", | ||
| "sass": "^1.58.3", | "sass": "^1.58.3", | ||
| "ts-jest": "^29.1.0", | |||
| "use-context-selector": "^1.4.4", | "use-context-selector": "^1.4.4", | ||
| "zustand": "^4.3.5" | "zustand": "^4.3.5" | ||
| }, | }, | ||
| "devDependencies": { | "devDependencies": { | ||
| "@faker-js/faker": "^9.0.3", | |||
| "@shelf/jest-mongodb": "^4.3.2", | |||
| "@svgr/webpack": "^6.5.1", | "@svgr/webpack": "^6.5.1", | ||
| "@types/formidable": "^2.0.5", | "@types/formidable": "^2.0.5", | ||
| "@types/js-yaml": "^4.0.9", | "@types/js-yaml": "^4.0.9", | ||
| ... | @@ -89,8 +83,6 @@ | ... | @@ -89,8 +83,6 @@ |
| "@types/request-ip": "^0.0.37", | "@types/request-ip": "^0.0.37", | ||
| "eslint": "8.56.0", | "eslint": "8.56.0", | ||
| "eslint-config-next": "14.2.3", | "eslint-config-next": "14.2.3", | ||
| "mockingoose": "^2.16.2", | |||
| "mongodb-memory-server": "^10.0.0", | |||
| "nextjs-node-loader": "^1.1.5", | "nextjs-node-loader": "^1.1.5", | ||
| "typescript": "^5.1.3" | "typescript": "^5.1.3" | ||
| } | } | ||
| ... | ... |
projects/app/src/test/workflow/loopTest.json
0 → 100644
projects/app/src/test/workflow/simple.json
0 → 100644
test/datas/users.ts
0 → 100644
test/mocks/index.ts
0 → 100644
test/mocks/request.ts
0 → 100644
test/setup.ts
0 → 100644
test/setupModels.ts
0 → 100644
test/test.ts
0 → 100644
test/utils/request.ts
0 → 100644
vitest.config.mts
0 → 100644
Please
register
or
sign in
to comment