Add unit tests for the Claude, Gemini and MiniMax director adapters
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Read test/providers.test.mjs:15-31 for the fake fetch pattern, then inspect the adapter entry points in server/providers/llm/index.mjs:7-63. Add test/llm.test.mjs assertions for the specified requests, parsed replies, URL overrides and empty reply error. Run node --test test/llm.test.mjs; done means those checks pass without network access or API keys.
Written by the indexing model from the issue text.
Description
Every image adapter has a scripted-fake test in test/providers.test.mjs. Director adapters are only tested once, indirectly: direct() with DeepSeek, through the shared OpenAI-compatible compat() adapter. These parts have no coverage:
- Claude (
anthropic.chat): thex-api-keyandanthropic-versionheaders, the top-levelsystemfield, and joining thetextblocks ofcontent - Gemini (
gemini.chat): thex-goog-api-keyheader,systemInstruction,responseMimeType: 'application/json', and readingcandidates[0].content.parts - MiniMax:
compat()deliberately leaves outresponse_formatforid === 'minimax'. Nothing checks that it stays out. - Base-URL overrides such as
DASHSCOPE_COMPAT_URLandMOONSHOT_BASE_URL, read throughbaseEnv - empty replies, which should throw
ProviderError … empty reply
Task: add test/llm.test.mjs that calls each adapter's chat() with a fake fetch, using the fake() pattern from test/providers.test.mjs. Assert on the request (URL, headers, body) and on the parsed text. No network or real keys.
Where: server/providers/llm/index.mjs:7-18 (compat), server/providers/llm/index.mjs:20-34 (anthropic), server/providers/llm/index.mjs:36-53 (gemini), server/providers/llm/index.mjs:63 (minimax entry); pattern to copy at test/providers.test.mjs:15-31.
Done when: node --test test/llm.test.mjs passes with no network and no keys set, asserting the request URL, headers and body plus the parsed text for Claude and Gemini, that the MiniMax request body has no response_format, that setting DASHSCOPE_COMPAT_URL or MOONSHOT_BASE_URL changes the request URL, and that an empty reply throws ProviderError with "empty reply"; npm test stays green.
Getting started: Node 22, no npm install needed: git clone, then npm test and npm run check. Comment here to claim it. Questions → Discord.
- Dominant language
- JavaScript
- Stars
- 42
- Forks
- 6
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blixvip/GenMotion
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
All issues in blixvip/GenMotion
Similar issues
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceOpenbug 🐛
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
comunica/comunica#1960 · 1 comment ·
Maintainers usually reply within 1 day
-
Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-javascript#26203 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bytedance/flowgram.ai#1235 ·
Maintainers usually reply within 1 day