Commit c3680f0
committed
test(ai-evals): add Mocha + Chai + Sinon test suite for runExperiment
Adds a unit test suite matching sibling action conventions:
- 8 tests covering all RunResult status branches (NOT_FOUND, CREATE_FAILED,
FAILED, PASS, REGRESSION) and exit codes (0/1/2/3)
- Stubs the SDK at its method boundary so tests are deterministic, fast,
and isolated from network/auth concerns
- Asserts CI metadata pass-through to experimentRuns.create as the 5th arg
- Asserts lifecycle progress messages
Tooling:
- mocha + chai + sinon + nyc (matches setup-env / setup-local / browserstack-report-action)
- ts-node loader so Mocha can read .ts source directly
- @typescript-eslint v8 (supports TypeScript 5.9)
- husky pre-commit hook: runs test + build + stages dist/ so src and dist
cannot drift in a published commit
'npm test' chains tsc --noEmit -> eslint -> nyc mocha with HTML coverage
report (coverage/index.html, gitignored).1 parent c5cab01 commit c3680f0
5 files changed
Lines changed: 4873 additions & 164 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
0 commit comments