testdriverai 7.2.90 → 7.2.91
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.
|
@@ -76,14 +76,20 @@ class InitCommand extends BaseCommand {
|
|
|
76
76
|
async promptForApiKey() {
|
|
77
77
|
const envPath = path.join(process.cwd(), ".env");
|
|
78
78
|
|
|
79
|
-
// Check if .env already exists with TD_API_KEY
|
|
79
|
+
// Check if .env already exists with a valid TD_API_KEY value
|
|
80
80
|
if (fs.existsSync(envPath)) {
|
|
81
81
|
const envContent = fs.readFileSync(envPath, "utf8");
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
);
|
|
86
|
-
|
|
82
|
+
// Match TD_API_KEY= that's not commented out and has a real value (not empty or placeholder)
|
|
83
|
+
const apiKeyMatch = envContent.match(/^TD_API_KEY=(.+)$/m);
|
|
84
|
+
if (apiKeyMatch) {
|
|
85
|
+
const value = apiKeyMatch[1].trim();
|
|
86
|
+
// Skip only if there's a real value (not empty or placeholder text)
|
|
87
|
+
if (value && value !== "your_api_key" && !value.startsWith("<") && !value.startsWith("$")) {
|
|
88
|
+
console.log(
|
|
89
|
+
chalk.gray("\n API key already configured in .env, skipping...\n"),
|
|
90
|
+
);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
95
|
|
|
@@ -400,7 +406,7 @@ class InitCommand extends BaseCommand {
|
|
|
400
406
|
printNextSteps() {
|
|
401
407
|
console.log(chalk.cyan("Next steps:\n"));
|
|
402
408
|
console.log(" 1. Run your tests:");
|
|
403
|
-
console.log(chalk.gray("
|
|
409
|
+
console.log(chalk.gray(" vitest run\n"));
|
|
404
410
|
console.log(" 2. Use AI agents to write tests:");
|
|
405
411
|
console.log(chalk.gray(" Open VSCode/Cursor and use @testdriver agent\n"));
|
|
406
412
|
console.log(" 3. MCP server configured:");
|
package/lib/init-project.js
CHANGED
|
@@ -1789,7 +1789,7 @@ API Key: The apiKey parameter is optional. If not provided, you'll need to manua
|
|
|
1789
1789
|
📚 Next steps:
|
|
1790
1790
|
|
|
1791
1791
|
1. Run your tests:
|
|
1792
|
-
|
|
1792
|
+
vitest run
|
|
1793
1793
|
|
|
1794
1794
|
2. Use AI agents to write tests:
|
|
1795
1795
|
Open VSCode/Cursor and use @testdriver agent
|