@testdriverai/mcp 7.9.149-test → 7.9.150-test

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.
@@ -16,6 +16,12 @@ function createCommandDefinitions(agent) {
16
16
  "AI client(s) to install into (comma-separated, or 'all'). e.g. --client claude-code,cursor. Omit for an interactive picker.",
17
17
  multiple: false,
18
18
  }),
19
+ "sample-test": Flags.boolean({
20
+ description:
21
+ "Scaffold the example test files (tests/example.test.js + tests/login.js). Use --no-sample-test to skip them (e.g. when an agent writes its own tests).",
22
+ default: true,
23
+ allowNo: true,
24
+ }),
19
25
  },
20
26
  handler: async () => {
21
27
  // This handler is special - it doesn't need an agent instance
@@ -59,6 +59,8 @@ class InitCommand extends BaseCommand {
59
59
  targetDir: process.cwd(),
60
60
  apiKey: apiKey,
61
61
  skipInstall: false,
62
+ // --no-sample-test sets flags["sample-test"] to false
63
+ skipSampleTest: flags["sample-test"] === false,
62
64
  clients: clients && clients.length ? clients : undefined,
63
65
  channel: channelConfig.active,
64
66
  onProgress: printProgress,
@@ -39,6 +39,7 @@ function runInstall(cmd, args, cwd, label) {
39
39
  * @param {string} [options.targetDir] - Target directory (defaults to current working directory)
40
40
  * @param {string} [options.apiKey] - TestDriver API key (will be saved to .env)
41
41
  * @param {boolean} [options.skipInstall=false] - Skip npm install step
42
+ * @param {boolean} [options.skipSampleTest=false] - Skip scaffolding the example test files (tests/example.test.js + tests/login.js). The tests/ dir, config, workflow, etc. are still created.
42
43
  * @param {boolean} [options.interactive=false] - Whether to prompt for missing values (CLI mode)
43
44
  * @param {string[]} [options.clients] - AI client ids to wire up (e.g. ["claude-code","cursor"] or ["all"]). When set, native per-client config is written instead of the interactive add-mcp flow.
44
45
  * @param {string} [options.channel] - Release channel (dev|test|canary|stable) the generated GitHub workflow should pin the action to. Defaults to the SDK's own active channel.
@@ -100,6 +101,11 @@ async function initProject(options = {}) {
100
101
  fs.mkdirSync(testDir, { recursive: true });
101
102
  }
102
103
 
104
+ // Sample test files (login snippet + example test). Skipped when the caller
105
+ // opts out (e.g. /eve, which scaffolds the project but writes its own tests).
106
+ if (options.skipSampleTest) {
107
+ progress("⊘ Skipped sample test files (tests/example.test.js, tests/login.js)");
108
+ } else {
103
109
  // Create login snippet file
104
110
  const loginSnippetFile = path.join(testDir, "login.js");
105
111
  if (!fs.existsSync(loginSnippetFile)) {
@@ -176,6 +182,7 @@ test('should login and add item to cart', async (context) => {
176
182
  fs.writeFileSync(testFile, vitestContent);
177
183
  progress("✓ Created test file: tests/example.test.js");
178
184
  }
185
+ }
179
186
 
180
187
  // 3. Create vitest.config.js
181
188
  const configFile = path.join(targetDir, "vitest.config.js");
@@ -1483,6 +1483,7 @@ API Key: The apiKey parameter is optional. If not provided, you'll need to manua
1483
1483
  directory: z.string().optional().describe("Target directory (defaults to current working directory)"),
1484
1484
  apiKey: z.string().optional().describe("TestDriver API key (will be saved to .env)"),
1485
1485
  skipInstall: z.boolean().default(false).describe("Skip npm install step"),
1486
+ skipSampleTest: z.boolean().default(false).describe("Skip scaffolding the example test files (tests/example.test.js + tests/login.js). Useful when an agent writes its own tests."),
1486
1487
  }),
1487
1488
  }, async (params) => {
1488
1489
  const startTime = Date.now();
@@ -1497,6 +1498,7 @@ API Key: The apiKey parameter is optional. If not provided, you'll need to manua
1497
1498
  targetDir,
1498
1499
  apiKey: params.apiKey,
1499
1500
  skipInstall: params.skipInstall,
1501
+ skipSampleTest: params.skipSampleTest,
1500
1502
  });
1501
1503
  const duration = Date.now() - startTime;
1502
1504
  logger.info("init: Completed", { targetDir, duration, success: result.success });
@@ -1802,6 +1802,7 @@ API Key: The apiKey parameter is optional. If not provided, you'll need to manua
1802
1802
  directory: z.string().optional().describe("Target directory (defaults to current working directory)"),
1803
1803
  apiKey: z.string().optional().describe("TestDriver API key (will be saved to .env)"),
1804
1804
  skipInstall: z.boolean().default(false).describe("Skip npm install step"),
1805
+ skipSampleTest: z.boolean().default(false).describe("Skip scaffolding the example test files (tests/example.test.js + tests/login.js). Useful when an agent writes its own tests."),
1805
1806
  }),
1806
1807
  },
1807
1808
  async (params): Promise<CallToolResult> => {
@@ -1820,6 +1821,7 @@ API Key: The apiKey parameter is optional. If not provided, you'll need to manua
1820
1821
  targetDir,
1821
1822
  apiKey: params.apiKey,
1822
1823
  skipInstall: params.skipInstall,
1824
+ skipSampleTest: params.skipSampleTest,
1823
1825
  });
1824
1826
 
1825
1827
  const duration = Date.now() - startTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testdriverai/mcp",
3
- "version": "7.9.149-test",
3
+ "version": "7.9.150-test",
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",