Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of Origins API Tests for Improved Robustness and Efficiency #122

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

yashkohli88
Copy link
Contributor

Description

This pull request refactors the originsTest.js file to enhance efficiency and reliability due to discrepancies in API responses between production and development environments.

Key Changes

  1. Logic Improvement:
  • Replaced strict equality checks with validation ensuring non-empty responses.
  • Confirmed keyword presence in packages and correct revision versioning.
  1. Function Renaming:
  • compareEndpoints to validateEndpointResponses.
  • compareOriginsWithRevisions to validateEndpointWithRevisions.
  • compareOrigins to validateOriginResponses.
  • getProviderType to resolveProviderType.
  1. Code Structure:
  • New utility functions: assertPackageResponse, assertRevisionResponse, normalizeVersion.

Other Updates:

  • Improved response assertions and clarified test case labels.

Copy link
Collaborator

@elrayle elrayle left a comment

Choose a reason for hiding this comment

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

Thanks for your efforts to improve tests. Always happy to see good tests.

@elrayle elrayle merged commit 0917b24 into clearlydefined:main Mar 12, 2025
2 checks 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.

2 participants