Skip to content

Commit

Permalink
test: 单元测试放弃 mocha, 使用 vitest
Browse files Browse the repository at this point in the history
Co-authored-by: ygqygq2 <[email protected]>
  • Loading branch information
ygqygq2 committed Jan 31, 2024
1 parent da54d6a commit 99a99ea
Show file tree
Hide file tree
Showing 8 changed files with 895 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .mocharc.jsonc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 配置专用于 mocha unit 测试,集成测试是使用 vscode-test
{
"require": ["ts-node/register", "tsconfig-paths/register"],
"diff": true,
"extension": ["ts"],
// "diff": true,
// "extension": ["ts"],
"spec": ["src/test/unit/*.spec.ts", "src/test/unit/**/*.spec.ts"],
"package": "./package.json",
// "package": "./package.json",
"timeout": "20000",
"ui": "bdd"
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"publish": "vsce publish --no-dependencies",
"test": "tsc -p ./ && vscode-test",
"test:suite": "node out/test/runTests.js",
"test:unit": "cross-env TS_NODE_PROJECT='src/test/tsconfig.json' mocha"
"test:unit": "vitest",
"coverage": "vitest run --coverage"
},
"devDependencies": {
"@types/chai": "^4.3.11",
Expand All @@ -175,7 +176,9 @@
"prettier": "^3.2.4",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vitest": "^1.2.2"
},
"license": "SEE LICENSE IN LICENSE.txt",
"bugs": {
Expand Down
Loading

0 comments on commit 99a99ea

Please sign in to comment.