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
- if (envContent.includes("TD_API_KEY=")) {
83
- console.log(
84
- chalk.gray("\n API key already configured in .env, skipping...\n"),
85
- );
86
- return null;
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(" npx vitest run\n"));
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:");
@@ -231,7 +231,7 @@ jobs:
231
231
  - name: Run TestDriver.ai tests
232
232
  env:
233
233
  TD_API_KEY: \${{ secrets.TD_API_KEY }}
234
- run: npx vitest run
234
+ run: vitest run
235
235
 
236
236
  - name: Upload test results
237
237
  if: always()
@@ -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
- npx vitest run
1792
+ vitest run
1793
1793
 
1794
1794
  2. Use AI agents to write tests:
1795
1795
  Open VSCode/Cursor and use @testdriver agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "7.2.90",
3
+ "version": "7.2.91",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "sdk.js",
6
6
  "types": "sdk.d.ts",