@alexkroman1/aai-cli 0.12.2 → 1.0.2

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.
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env node
2
- import { log } from "./_ui-DWGXImbO.mjs";
3
- import { existsSync } from "node:fs";
4
- import path from "node:path";
5
- import { execSync } from "node:child_process";
6
- //#region test.ts
7
- /**
8
- * `aai test` — run agent tests via vitest.
9
- */
10
- /**
11
- * Run vitest in the given project directory.
12
- *
13
- * Returns `true` if tests passed, `false` if no test files exist.
14
- * Throws on test failure.
15
- */
16
- function runVitest(cwd) {
17
- if (!(existsSync(path.join(cwd, "agent.test.ts")) || existsSync(path.join(cwd, "agent.test.js")))) return false;
18
- execSync(`npx vitest run --root . ${existsSync(path.join(cwd, "agent.test.ts")) ? "agent.test.ts" : "agent.test.js"}`, {
19
- cwd,
20
- stdio: "inherit",
21
- env: {
22
- ...process.env,
23
- NODE_OPTIONS: "--experimental-strip-types"
24
- }
25
- });
26
- return true;
27
- }
28
- /** Run agent tests. Used by `aai test`. */
29
- async function runTestCommand(cwd) {
30
- log.step("Running agent tests");
31
- if (!runVitest(cwd)) {
32
- log.info("No test file found. Create agent.test.ts to add tests.");
33
- return;
34
- }
35
- log.success("Tests passed");
36
- }
37
- //#endregion
38
- export { runTestCommand, runVitest };