ai-unit-test-generator 3.1.1 โ 3.1.3
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
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.1.3] - 2025-10-15
|
|
9
|
+
|
|
10
|
+
### ๐ Critical Bug Fix (Complete)
|
|
11
|
+
- **Fixed**: All remaining `lib/` path references in batch.ts and parallel-generate.ts
|
|
12
|
+
- **Fixed**: prompt-builder.js, client.js, extractor.js, runner.js, analyzer.js path resolution
|
|
13
|
+
- **Fixed**: Generate workflow now fully functional when installed as npm package
|
|
14
|
+
|
|
15
|
+
### ๐ Files Modified
|
|
16
|
+
- `src/workflows/batch.ts` - Fixed 5 module path references
|
|
17
|
+
- `src/workflows/parallel-generate.ts` - Fixed 3 module path references
|
|
18
|
+
|
|
19
|
+
## [3.1.2] - 2025-10-15
|
|
20
|
+
|
|
21
|
+
### ๐ Critical Bug Fix
|
|
22
|
+
- **Fixed**: Module path resolution in workflows - corrected hardcoded `lib/workflows/batch.mjs` to `dist/workflows/batch.js`
|
|
23
|
+
- **Fixed**: Generate command now works correctly when installed as npm package
|
|
24
|
+
- **Fixed**: Iterative improvement workflow path resolution
|
|
25
|
+
- **Fixed**: Parallel generation workflow path resolution
|
|
26
|
+
|
|
27
|
+
### ๐ Files Modified
|
|
28
|
+
- `src/workflows/generate.ts` - Fixed batch script path
|
|
29
|
+
- `src/workflows/iterative-improve.ts` - Fixed 2 batch script path references
|
|
30
|
+
- `src/workflows/all.ts` - Fixed batch script path
|
|
31
|
+
|
|
8
32
|
## [3.1.1] - 2025-10-15
|
|
9
33
|
|
|
10
34
|
### ๐ Bug Fixes
|
package/dist/workflows/all.js
CHANGED
|
@@ -54,7 +54,7 @@ Batch starting... priority=${priority}, size=${batchSize}, skip=${skip}
|
|
|
54
54
|
Remaining TODO: ${remain}
|
|
55
55
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ`);
|
|
56
56
|
try {
|
|
57
|
-
await sh('node', [join(pkgRoot, '
|
|
57
|
+
await sh('node', [join(pkgRoot, 'dist/workflows/batch.js'), priority, String(batchSize), String(skip)]);
|
|
58
58
|
}
|
|
59
59
|
catch (err) {
|
|
60
60
|
const message = err instanceof Error ? err.message : String(err);
|
package/dist/workflows/batch.js
CHANGED
|
@@ -102,7 +102,7 @@ async function main(argv = process.argv) {
|
|
|
102
102
|
console.log(`๐ Initial coverage: ${beforeCov.toFixed(2)}%`);
|
|
103
103
|
// 1) ็ๆ Prompt๏ผๅช้ๅฏน TODO ๅฝๆฐ๏ผๅ ๅ
ฅไธไธ่ฝฎๅคฑ่ดฅๆ็คบ๏ผ
|
|
104
104
|
const promptArgs = [
|
|
105
|
-
join(pkgRoot, '
|
|
105
|
+
join(pkgRoot, 'dist/ai/prompt-builder.js'),
|
|
106
106
|
'--report', reportPath
|
|
107
107
|
];
|
|
108
108
|
// ๅชๆๅฝ priority ๅญๅจๆถๆๆทปๅ -p ๅๆฐ
|
|
@@ -125,17 +125,17 @@ async function main(argv = process.argv) {
|
|
|
125
125
|
writeFileSync('prompt.txt', promptText);
|
|
126
126
|
// 2) ่ฐ็จ AI
|
|
127
127
|
console.log('\n๐ค Calling AI...');
|
|
128
|
-
await spawnCommand('node', [join(pkgRoot, '
|
|
128
|
+
await spawnCommand('node', [join(pkgRoot, 'dist/ai/client.js'), 'prompt.txt'], { captureStdout: true });
|
|
129
129
|
// 3) ๆๅๆต่ฏ
|
|
130
130
|
console.log('\n๐ฆ Extracting tests...');
|
|
131
|
-
await spawnCommand('node', [join(pkgRoot, '
|
|
131
|
+
await spawnCommand('node', [join(pkgRoot, 'dist/ai/extractor.js'), 'reports/ai_response.txt', '--overwrite']);
|
|
132
132
|
// 4) ่ฟ่ก Jest๏ผๆไผๅ
็บง่ช้ๅบ้่ท๏ผ
|
|
133
133
|
console.log('\n๐งช Running tests...');
|
|
134
134
|
const reruns = priority === 'P0' ? 1 : 0;
|
|
135
135
|
let testsPassed = false;
|
|
136
136
|
for (let i = 0; i < Math.max(1, reruns + 1); i++) {
|
|
137
137
|
try {
|
|
138
|
-
await spawnCommand('node', [join(pkgRoot, '
|
|
138
|
+
await spawnCommand('node', [join(pkgRoot, 'dist/testing/runner.js')]);
|
|
139
139
|
testsPassed = true;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
@@ -172,7 +172,7 @@ async function main(argv = process.argv) {
|
|
|
172
172
|
const { spawn: spawnLocal } = await import('node:child_process');
|
|
173
173
|
const { writeFileSync: writeFileSyncLocal } = await import('node:fs');
|
|
174
174
|
await new Promise((resolve) => {
|
|
175
|
-
const child = spawnLocal('node', [join(pkgRoot, '
|
|
175
|
+
const child = spawnLocal('node', [join(pkgRoot, 'dist/testing/analyzer.js')], { stdio: ['inherit', 'pipe', 'inherit'] });
|
|
176
176
|
const chunks = [];
|
|
177
177
|
if (child.stdout) {
|
|
178
178
|
child.stdout.on('data', (d) => chunks.push(d));
|
|
@@ -21,7 +21,7 @@ const PKG_ROOT = join(__dirname, '../..');
|
|
|
21
21
|
* @returns ๆนๆฌก็ปๆ
|
|
22
22
|
*/
|
|
23
23
|
async function generateBatch(priority, count, skip, report) {
|
|
24
|
-
const batchScript = join(PKG_ROOT, '
|
|
24
|
+
const batchScript = join(PKG_ROOT, 'dist/workflows/batch.js');
|
|
25
25
|
return new Promise((resolve, reject) => {
|
|
26
26
|
const child = spawn('node', [batchScript, priority, String(count), String(skip), report], {
|
|
27
27
|
stdio: 'inherit',
|
|
@@ -198,7 +198,7 @@ export async function iterativeImprove(options = {}) {
|
|
|
198
198
|
console.log(`\n ๐ฒ Sample ${sampleIdx + 1}/${samplesPerIteration}...`);
|
|
199
199
|
// ็ๆๅ้ๆต่ฏ
|
|
200
200
|
await spawnCommand('node', [
|
|
201
|
-
join(PKG_ROOT, '
|
|
201
|
+
join(PKG_ROOT, 'dist/workflows/batch.js'),
|
|
202
202
|
'null', // priority (as string for CLI arg)
|
|
203
203
|
'10', // limit
|
|
204
204
|
'0', // skip
|
|
@@ -235,7 +235,7 @@ export async function iterativeImprove(options = {}) {
|
|
|
235
235
|
else {
|
|
236
236
|
// ๅๆ ทๆฌๆจกๅผ๏ผๅๆ้ป่พ๏ผ
|
|
237
237
|
await spawnCommand('node', [
|
|
238
|
-
join(PKG_ROOT, '
|
|
238
|
+
join(PKG_ROOT, 'dist/workflows/batch.js'),
|
|
239
239
|
'null', // priority
|
|
240
240
|
'10', // limit
|
|
241
241
|
'0', // skip
|
|
@@ -178,7 +178,7 @@ async function generateBatch(batch, batchIndex, options = {}) {
|
|
|
178
178
|
// 1. ็ๆ Prompt๏ผๅชๅ
ๅซ่ฟไธชๆนๆฌก็ๅฝๆฐ๏ผ
|
|
179
179
|
const reportArg = reportPath || 'reports/ut_scores.md';
|
|
180
180
|
const promptArgs = [
|
|
181
|
-
join(PKG_ROOT, '
|
|
181
|
+
join(PKG_ROOT, 'dist/ai/prompt-builder.js'),
|
|
182
182
|
'--report', reportArg,
|
|
183
183
|
'--only-todo'
|
|
184
184
|
];
|
|
@@ -207,13 +207,13 @@ async function generateBatch(batch, batchIndex, options = {}) {
|
|
|
207
207
|
// 2. ่ฐ็จ AI
|
|
208
208
|
const aiResponsePath = join(batchDir, 'ai_response.txt');
|
|
209
209
|
await sh('node', [
|
|
210
|
-
join(PKG_ROOT, '
|
|
210
|
+
join(PKG_ROOT, 'dist/ai/client.js'),
|
|
211
211
|
'--prompt', promptPath || '',
|
|
212
212
|
'--out', aiResponsePath || ''
|
|
213
213
|
], { captureStdout: false, cwd: process.cwd(), env: {} });
|
|
214
214
|
// 3. ๆๅๆต่ฏ
|
|
215
215
|
await sh('node', [
|
|
216
|
-
join(PKG_ROOT, '
|
|
216
|
+
join(PKG_ROOT, 'dist/ai/extractor.js'),
|
|
217
217
|
aiResponsePath || '',
|
|
218
218
|
'--overwrite'
|
|
219
219
|
], { captureStdout: false, cwd: process.cwd(), env: {} });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-unit-test-generator",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "AI-powered unit test generator with smart priority scoring, parallel generation, behavior classification, test validation, and deduplication",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unit-test",
|