Skip to content

Conversation

@louis-jan
Copy link
Contributor

Describe Your Changes

This PR aims to update the cortex API request regarding the default engine variant. Previously, the settings payload was included in the search parameters, but it’s now correct to include it in the body of the request.

Fixes Issues

Changes made

  1. API Request Changes:

    • Added explicit JSON payload (version, variant) while posting to the ky.post method to support a legacy API.
  2. Test Enhancements:

    • Imports: Added import for fork from the child_process module.
    • Mocks: Implemented a mock for child_process.fork to simulate child process behavior.
    • Test Cases:
      • Updated test descriptions for more clarity.
      • Used mockFork to define behavior for fork mock, especially handling messages for CPU instruction sets.
      • Changed test assertions to use resolves.toEqual or resolves.toBe to handle asynchronous operations with promises.
      • Duplication of logic was reduced by introducing modular mock process handling.
  3. General Formatting:

    • Minor string formatting adjustments (e.g., consistent use of single quotes).

These changes focus on improving API interaction robustness and enhancing test reliability through better simulation of asynchronous operations.

@louis-jan louis-jan changed the title test: correct test cases feat: update Jan’s client request to adapt API changes from Cortex Nov 26, 2024
@louis-jan louis-jan marked this pull request as ready for review November 26, 2024 09:24
@louis-jan louis-jan requested a review from a team November 26, 2024 09:24
@github-actions
Copy link
Contributor

Barecheck - Code coverage report

Total: 69.18%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@louis-jan
Copy link
Contributor Author

@louis-jan louis-jan merged commit 2478cf7 into dev Nov 26, 2024
21 checks passed
@louis-jan louis-jan deleted the chore/4123-update-default-engine-request-body branch November 26, 2024 14:38
@github-actions github-actions bot added this to the v0.5.10 milestone Nov 26, 2024
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