OpenFn / OpenFn/kit

cli: unit tests for apollo command

Open
#702 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevX good first issue
Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

I am not planning to do this before the apollo release, so here's some notes:

  • Unit tests need to mock an apollo server. Not totally easy as it needs to be a websocket server.
  • Don't test services, but test CLI behaviours. Like how to handle a { files } result
  • Ideally I'd like tests against the echo service which can be easily reproduced with the actual CLI. So I can copy and paste the test name and just run it - a bit like how our integration tests work
  • I don't want any integration tests on this right now

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Apollo CLI command and the existing integration tests, then inspect how the echo service is invoked. The work is done when CLI behaviours such as handling a { files } result are covered with a mocked Apollo WebSocket server, with no new integration tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.