test(pricing): verify MODEL_COSTS entries and promotional notes

Add tests/test-pricing.ts to assert that known models have non-zero
pricing, promotional deals are documented in comments, and Claude models
include cache pricing. Fix test-pi-local to match against combined
stdout+stderr since pi may output model listing to either stream.
This commit is contained in:
Fei Yan
2026-05-27 07:32:50 +08:00
parent 567e1e28a4
commit e8f7410a0a
4 changed files with 105 additions and 7 deletions
+4 -3
View File
@@ -294,9 +294,10 @@ try {
modelListRequestCount = 0
const list = await runPi(["--no-extensions", "-e", EXT_PATH, "--list-models"], 20_000)
assert.equal(list.code, 0, list.stderr)
assert.match(list.stdout, /commandcode/)
assert.match(list.stdout, /deepseek\/deepseek-v4-flash/)
assert.match(list.stdout, /Qwen\/Qwen3\.7-Max/)
const listOutput = `${list.stdout}\n${list.stderr}`
assert.match(listOutput, /commandcode/)
assert.match(listOutput, /deepseek\/deepseek-v4-flash/)
assert.match(listOutput, /Qwen\/Qwen3\.7-Max/)
assert.equal(modelListRequestCount, 1)
console.log("[pi-local] print mode through real extension and mock API")