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
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "pi-commandcode-provider",
"version": "0.1.1",
"version": "0.2.0",
"description": "pi custom provider for Command Code API (commandcode.ai)",
"type": "module",
"keywords": [
@@ -28,12 +28,13 @@
"LICENSE"
],
"scripts": {
"test": "npm run typecheck && tsx tests/test-pure-functions.ts && tsx tests/test-models.ts && tsx tests/test-oauth.ts && tsx tests/test-abort.ts && tsx tests/test-stream.ts && node tests/test-pi-local.mjs",
"test": "npm run typecheck && tsx tests/test-pure-functions.ts && tsx tests/test-models.ts && tsx tests/test-pricing.ts && tsx tests/test-oauth.ts && tsx tests/test-abort.ts && tsx tests/test-stream.ts && node tests/test-pi-local.mjs",
"typecheck": "tsc --noEmit",
"format:check": "prettier --check '**/*.{ts,mjs,json,md}'",
"format": "prettier --write '**/*.{ts,mjs,json,md}'",
"test:unit": "tsx tests/test-pure-functions.ts",
"test:models": "tsx tests/test-models.ts",
"test:pricing": "tsx tests/test-pricing.ts",
"test:oauth": "tsx tests/test-oauth.ts",
"test:abort": "tsx tests/test-abort.ts",
"test:stream": "tsx tests/test-stream.ts",