Skip to content

test: add unit tests for pure helpers in app/utils#6815

Merged
Leizhenpeng merged 1 commit into
ChatGPTNextWeb:mainfrom
TIANQIAN1238:feat-utils-unit-tests
Jul 6, 2026
Merged

test: add unit tests for pure helpers in app/utils#6815
Leizhenpeng merged 1 commit into
ChatGPTNextWeb:mainfrom
TIANQIAN1238:feat-utils-unit-tests

Conversation

@TIANQIAN1238

Copy link
Copy Markdown
Contributor

💻 变更类型 | Change Type

  • test

🔀 变更说明 | Description of Change

Adds a new test/utils.test.ts covering several previously untested pure helper functions in app/utils.ts:

  • trimTopic
  • semverCompare
  • getMessageTextContent
  • getMessageTextContentWithoutThinking
  • getMessageImages
  • isDalle3
  • getModelSizes / supportsCustomSize

These are pure functions with no side effects, so the tests are deterministic and fast. No production code is modified.

📝 补充信息 | Additional Information

All test suites pass locally (jest): 5 suites, 34 tests. Formatting verified with Prettier.

🤖 Generated with Claude Code

Cover previously untested pure functions: trimTopic, semverCompare,
getMessageTextContent, getMessageTextContentWithoutThinking,
getMessageImages, isDalle3, getModelSizes and supportsCustomSize.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Leizhenpeng
Leizhenpeng merged commit 2586cc6 into ChatGPTNextWeb:main Jul 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants