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

Add tests for ai.js #20

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Add tests for ai.js #20

merged 3 commits into from
Nov 12, 2024

Conversation

AnhChienVu
Copy link
Owner

@AnhChienVu AnhChienVu commented Nov 12, 2024

Description

I have written some tests for ai.js file

Changes Made

There are 4 tests for ai.js:

  • Return a parsed temperature properly
  • Should throw error if parsed temperature is NaN type
  • Should handle ouput file if options.output is provided
  • Should throw error if initializeModel() function throws error

Testing Details

I have used the mocking function feature of Jest to mock the returned value from relative functions that are used inside ai.js

Impact

The test made sure that the current code for ai.js is covered 100%

Checklist

  • Code compiles correctly
  • Tests have been written and run
  • Code adheres to the style guidelines
  • Ready for review

@AnhChienVu AnhChienVu merged commit dbb861f into main Nov 12, 2024
3 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.

1 participant