ai-worktool 1.0.78 → 1.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/agents/prompt.js +7 -4
- package/dist/tools/file.js +1 -0
- package/dist/tools/jest.js +9 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/agents/prompt.js
CHANGED
|
@@ -47,10 +47,13 @@ async function addUncoveredLinePrompt(srcPath, report) {
|
|
|
47
47
|
? report.coverage.branches.pct
|
|
48
48
|
: report.coverage.statements.pct;
|
|
49
49
|
const unitName = report.coverage.functions.pct < 100 ? '函数' : '行';
|
|
50
|
-
const lines = (report.
|
|
51
|
-
report.uncoveredLines.
|
|
52
|
-
report.
|
|
53
|
-
|
|
50
|
+
const lines = (report.coverage.functions.pct < 100
|
|
51
|
+
? report.uncoveredLines.functions
|
|
52
|
+
: report.coverage.lines.pct < 100
|
|
53
|
+
? report.uncoveredLines.lines
|
|
54
|
+
: report.coverage.branches.pct < 100
|
|
55
|
+
? report.uncoveredLines.branches
|
|
56
|
+
: report.uncoveredLines.statements).join(',');
|
|
54
57
|
return (`源文件"${path_1.default.resolve(srcPath)}"的单元测试${pctType}覆盖率是${pct}%, 还有行号是"${lines}"的${unitName}未完全覆盖单测。
|
|
55
58
|
|
|
56
59
|
源文件内容如下:
|
package/dist/tools/file.js
CHANGED
package/dist/tools/jest.js
CHANGED
|
@@ -84,15 +84,15 @@ async function createJestConfigFile(configPath, options = {}) {
|
|
|
84
84
|
},
|
|
85
85
|
collectCoverage: true,
|
|
86
86
|
// 指定需要统计覆盖率的源代码路径(关键配置)
|
|
87
|
-
collectCoverageFrom: [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
],
|
|
87
|
+
// collectCoverageFrom: [
|
|
88
|
+
// // 匹配所有源代码文件(根据项目目录结构调整)
|
|
89
|
+
// 'src/**/*.{js,jsx,ts,tsx}', // 例如:src 目录下所有 JS/TS 文件
|
|
90
|
+
// '!src/**/*.d.ts', // 排除类型定义文件(可选)
|
|
91
|
+
// '!src/mocks/**', // 排除 mock 文件(可选)
|
|
92
|
+
// '!src/**/index.{js,ts}', // 排除入口文件(可选,根据需求调整)
|
|
93
|
+
// '!**/node_modules/**', // 排除 node_modules
|
|
94
|
+
// '!**/vendor/**' // 排除第三方依赖(如有)
|
|
95
|
+
// ],
|
|
96
96
|
coverageDirectory: 'coverage',
|
|
97
97
|
coverageReporters: ['json-summary', 'lcov', 'text', 'clover'],
|
|
98
98
|
testPathIgnorePatterns: ['/node_modules/']
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-worktool",
|
|
3
3
|
"displayName": "吃豆豆:单测智能体",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.79",
|
|
5
5
|
"description": "单元测试智能体,帮你开发单元测试用例代码直到100%单测覆盖通过。",
|
|
6
6
|
"author": "jianguoke.cn",
|
|
7
7
|
"license": "MIT",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"createup": "node ./uposs.js create-local-folder",
|
|
29
29
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
30
30
|
"puball": "yarn ver && yarn exepack && yarn vspack && yarn pubvs && yarn pubovsx && yarn puboss && yarn pubnpm",
|
|
31
|
-
"exepack": "yarn createup && cross-env PKG_CACHE_PATH=./binaries pkg -o packages/aicoder-1.0.
|
|
31
|
+
"exepack": "yarn createup && cross-env PKG_CACHE_PATH=./binaries pkg -o packages/aicoder-1.0.79 . && yarn upicon",
|
|
32
32
|
"pubvs": "yarn remove-deps && yarn changelog && vsce publish --yarn --baseContentUrl https://aicoder.jianguoke.cn/assets && yarn restore-deps",
|
|
33
33
|
"pubovsx": "yarn remove-deps && ovsx publish -p 47621ff6-be56-4814-865e-d2a8e8a76f86 --yarn --baseContentUrl https://aicoder.jianguoke.cn/assets && yarn restore-deps",
|
|
34
34
|
"patch": "yarn remove-deps && vsce publish patch --yarn && yarn restore-deps",
|
|
35
|
-
"vspack": "yarn createup && yarn remove-deps && vsce package -o packages/aicoder-1.0.
|
|
35
|
+
"vspack": "yarn createup && yarn remove-deps && vsce package -o packages/aicoder-1.0.79.vsix --yarn --baseContentUrl https://aicoder.jianguoke.cn/assets && yarn restore-deps",
|
|
36
36
|
"puboss": "node ./uposs.js upload",
|
|
37
37
|
"pubnpm": "npm publish --registry=https://registry.npmjs.org",
|
|
38
38
|
"prepare": "husky"
|