test: add count tokens endpoint test suite

Add comprehensive test suite for /v1/messages/count_tokens endpoint:
- Simple text messages
- Multi-turn conversations
- System prompts (string and array format)
- Tool definitions and tool use/result blocks
- Thinking blocks
- Content arrays with text blocks
- Error handling for invalid requests
- Long text tokenization

Also adds npm script test:counttokens for running tests individually.
This commit is contained in:
minhphuc429
2026-01-14 15:36:11 +07:00
parent acc228b920
commit 53da774bb6
3 changed files with 455 additions and 2 deletions

View File

@@ -34,7 +34,8 @@
"test:crossmodel": "node tests/test-cross-model-thinking.cjs",
"test:oauth": "node tests/test-oauth-no-browser.cjs",
"test:emptyretry": "node tests/test-empty-response-retry.cjs",
"test:sanitizer": "node tests/test-schema-sanitizer.cjs"
"test:sanitizer": "node tests/test-schema-sanitizer.cjs",
"test:counttokens": "node tests/test-count-tokens.cjs"
},
"keywords": [
"claude",