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 Test Suite and Mock OpenAI API Calls #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Aug 5, 2023

Description

This PR adds a test suite to the project and mocks the OpenAI API calls to avoid spending tokens during testing. The test suite includes tests for all functions in the codebase, ensuring comprehensive coverage. The OpenAI API calls are mocked using mock functions, simulating the behavior of the API without making actual requests.

Summary of Changes

  • Added mock functions in lib/laymanscode.js to simulate the behavior of the OpenAI API during testing.
  • Exported all functions in lib/gptcl.js to make them accessible for testing.
  • Created test/laymanscode.test.js to contain tests for the functions in laymanscode.js. Used Jest or Mocha framework to write the tests and mocked the OpenAI API calls.
  • Created test/gptcl.test.js to contain tests for the functions in gptcl.js. Used Jest or Mocha framework to write the tests.

Please review and merge this PR to incorporate the test suite and ensure accurate test results without spending tokens on OpenAI.

Fixes #4.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/test-suite-mock-openai-api

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 5, 2023
@sweep-ai sweep-ai bot mentioned this pull request Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Test Suite Needed
0 participants