Skip to content

Mock translation results in tests#76

Merged
alexbock2 merged 3 commits intomainfrom
claude/mock-translator-tests-AACLW
Apr 4, 2026
Merged

Mock translation results in tests#76
alexbock2 merged 3 commits intomainfrom
claude/mock-translator-tests-AACLW

Conversation

@BAIZIKING
Copy link
Copy Markdown

The translation service takes too long to run since it needs to start the LLM. This change adds a check so that the translation service does not run in tests.

Changelog:

  • src/translate/index.js: Add a check so that if process.env.CI = 'true' then we use mock results instead of real results

alexbock2 and others added 3 commits April 3, 2026 23:35
Tests that create posts or topics were timing out because the fetch
call to the translator microservice has no timeout and can hang
indefinitely. Since process.env.CI is already set to 'true' by
test/mocks/databasemock.js, add an early-return guard in
src/translate/index.js that returns a mock response [true, content]
without making any network request.

https://claude.ai/code/session_014JDLGWiu1ZzgdD8mCv98aZ
@alexbock2 alexbock2 merged commit 95f46c5 into main Apr 4, 2026
1 check passed
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.

3 participants