ai-unit-test-generator 2.0.5 β 2.0.7
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 +18 -0
- package/lib/ai/client.mjs +2 -1
- package/lib/workflows/batch.mjs +24 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -5,6 +5,24 @@ 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
|
+
## [2.0.7] - 2025-01-11
|
9
|
+
|
10
|
+
### π Hotfix
|
11
|
+
- **Fixed**: `ai-test generate` workflow - `batch.mjs` now properly captures `prompt-builder.mjs` stdout and writes to `prompt.txt`
|
12
|
+
- Modified `sh()` helper to support stdout capture with `captureStdout` option
|
13
|
+
- Resolves missing `prompt.txt` file issue in generation workflow
|
14
|
+
|
15
|
+
---
|
16
|
+
|
17
|
+
## [2.0.6] - 2025-01-11
|
18
|
+
|
19
|
+
### π Hotfix
|
20
|
+
- **Fixed**: `ai-test generate` command - corrected `client.mjs` argument parsing
|
21
|
+
- Now supports `--prompt`, `--prompt-file`, and `--promptFile` for compatibility
|
22
|
+
- Resolves `Prompt file not found: prompt.txt` error in batch generation workflow
|
23
|
+
|
24
|
+
---
|
25
|
+
|
8
26
|
## [2.0.5] - 2025-01-11
|
9
27
|
|
10
28
|
### β¨ Feature: Simplified AI Suggestion Review
|
package/lib/ai/client.mjs
CHANGED
@@ -60,7 +60,8 @@ export async function runOnce({ prompt, promptFile, out = 'reports/ai_response.t
|
|
60
60
|
|
61
61
|
export async function runCLI(argv = process.argv) {
|
62
62
|
const args = parseArgs(argv)
|
63
|
-
|
63
|
+
// ζ―ζ --prompt, --prompt-file, --promptFile δΈη§ε½’εΌ
|
64
|
+
const promptFile = args['prompt'] || args['prompt-file'] || args['promptFile'] || null
|
64
65
|
const out = args['out'] || 'reports/ai_response.txt'
|
65
66
|
const model = args['model'] || null
|
66
67
|
const timeoutSec = args['timeout'] ? Number(args['timeout']) : 600
|
package/lib/workflows/batch.mjs
CHANGED
@@ -12,10 +12,24 @@ const __filename = fileURLToPath(import.meta.url)
|
|
12
12
|
const __dirname = dirname(__filename)
|
13
13
|
const pkgRoot = join(__dirname, '../..')
|
14
14
|
|
15
|
-
function sh(cmd, args = []) {
|
15
|
+
function sh(cmd, args = [], options = {}) {
|
16
16
|
return new Promise((resolve, reject) => {
|
17
|
-
const
|
18
|
-
child
|
17
|
+
const stdio = options.captureStdout ? ['inherit', 'pipe', 'inherit'] : 'inherit'
|
18
|
+
const child = spawn(cmd, args, { stdio, cwd: process.cwd() })
|
19
|
+
|
20
|
+
const chunks = []
|
21
|
+
if (options.captureStdout) {
|
22
|
+
child.stdout.on('data', d => chunks.push(Buffer.from(d)))
|
23
|
+
}
|
24
|
+
|
25
|
+
child.on('close', code => {
|
26
|
+
if (code === 0) {
|
27
|
+
const output = options.captureStdout ? Buffer.concat(chunks).toString('utf8') : null
|
28
|
+
resolve(output)
|
29
|
+
} else {
|
30
|
+
reject(new Error(`${cmd} exited ${code}`))
|
31
|
+
}
|
32
|
+
})
|
19
33
|
child.on('error', reject)
|
20
34
|
})
|
21
35
|
}
|
@@ -112,11 +126,16 @@ async function main(argv = process.argv) {
|
|
112
126
|
'--skip', String(skip),
|
113
127
|
'--only-todo' // ζ°ε’οΌεͺε€η TODO ηΆζ
|
114
128
|
]
|
129
|
+
|
130
|
+
let promptText
|
115
131
|
try {
|
116
|
-
await sh('node', [...promptArgs, '--hints-file', 'reports/hints.txt'])
|
132
|
+
promptText = await sh('node', [...promptArgs, '--hints-file', 'reports/hints.txt'], { captureStdout: true })
|
117
133
|
} catch {
|
118
|
-
await sh('node', promptArgs)
|
134
|
+
promptText = await sh('node', promptArgs, { captureStdout: true })
|
119
135
|
}
|
136
|
+
|
137
|
+
// εε
₯ prompt.txt
|
138
|
+
writeFileSync('prompt.txt', promptText, 'utf-8')
|
120
139
|
|
121
140
|
// 2) θ°η¨ AI
|
122
141
|
console.log('\nπ€ Calling AI...')
|