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

test: add missing tests to Jan core modules #3716

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

louis-menlo
Copy link
Contributor

@louis-menlo louis-menlo commented Sep 23, 2024

Describe Your Changes

This PR adds missing tests for the core module and its types, specifically for browser and extension cases.

There is also a minor configuration update that could help tests be generated more efficiently.

These tests are auto-generated.

New tests

  1. In core/src/browser/tools/tool.test.ts:

    • Test to check if an error is thrown when process is called without implementation.
  2. In core/src/node/api/processors/extension.test.ts:

    • Test to handle empty extension list for install.
    • Test to handle empty extension list for update.
    • Test to handle empty extension list for uninstall.
  3. In core/src/node/helper/config.test.ts:

    • Test to check if extensions path is returned when retrieved successfully.
    • Test to check if data folder path is returned when retrieved successfully.
  4. In web/utils/modelParam.test.ts:

    • Test to handle invalid values correctly by falling back to originParams.
    • Test to return an empty object when no modelParams are provided for extractModelLoadParams.
    • Test to return an empty object when no modelParams are provided for extractInferenceParams.
  5. In web/utils/threadMessageBuilder.test.ts:

    • Test to check pushMessage with prompt only.
    • Test to check pushMessage with PDF.
    • Test to check pushMessage with image.

These new tests cover various scenarios and edge cases in different parts of the codebase, improving overall test coverage.

@github-actions github-actions bot added the type: chore Maintenance, operational label Sep 23, 2024
Copy link
Contributor

Barecheck - Code coverage report

Total: 59.62%

Your code coverage diff: 1.01% ▴

✅ All code changes are covered

@louis-menlo louis-menlo marked this pull request as ready for review September 23, 2024 02:53
Copy link
Contributor

@dan-menlo dan-menlo left a comment

Choose a reason for hiding this comment

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

Lgtm, thank you @louis-jan

@louis-menlo louis-menlo merged commit c5e0c93 into dev Sep 23, 2024
11 checks passed
@louis-menlo louis-menlo deleted the test/add-missing-tests branch September 23, 2024 06:54
@github-actions github-actions bot added this to the v0.5.5 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Maintenance, operational
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants