Skip to content

Conversation

@bmesuere
Copy link
Member

Instead of simple mocks, use polly and recordings to mock all tests.

Copilot AI review requested due to automatic review settings January 10, 2026 13:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request replaces manual mock implementations with Polly.js for HTTP recording and replay in tests. The change removes hardcoded API response data and manual fetch mocking in favor of real HTTP recordings that can be replayed during test execution.

Changes:

  • Migrated from manual mocks to Polly.js with HTTP recording/replay
  • Added Polly.js dependencies and setup infrastructure
  • Created HAR recordings for API endpoints (taxonomy, taxa2lca, protinfo, pept2lca, pept2go)
  • Updated test files to use Polly setup and teardown

Reviewed changes

Copilot reviewed 21 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Added Polly.js dev dependencies and test:record script
yarn.lock Added Polly.js packages and transitive dependencies
tests/mocks/polly.ts New Polly configuration and setup helper function
tests/mocks/mockFetch.ts Removed manual fetch mock implementation
tests/mocks/apiData.ts Removed hardcoded API response data
tests/recordings/*.har Added HAR recordings for various API endpoints
tests/commands/unipept/taxonomy.test.ts Updated to use Polly with proper setup/teardown
tests/commands/unipept/taxa2lca.test.ts Updated to use Polly with proper setup/teardown
vitest.config.ts Increased test timeout to 10000ms

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bmesuere bmesuere requested a review from pverscha January 10, 2026 13:41
Copy link
Member

@pverscha pverscha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! No remarks from my side.

@bmesuere bmesuere merged commit b2e6185 into main Jan 14, 2026
3 checks passed
@bmesuere bmesuere deleted the feat/better-mocks branch January 14, 2026 12:53
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