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

feat: ci test #41

Merged
merged 1 commit into from
Jul 27, 2023
Merged

feat: ci test #41

merged 1 commit into from
Jul 27, 2023

Conversation

mattzcarey
Copy link
Owner

No description provided.

@github-actions
Copy link
Contributor

LOGAF Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/prompt/constructPrompt/constructPrompt.test.ts

Feedback:

  1. The stringifyMargin variable is not clear in its purpose. Consider renaming it to something more descriptive or adding a comment to explain its purpose.

  2. The isCi variable is hardcoded to false. If this is a test that should behave differently in a CI environment, consider making this a parameter to the test function or reading it from an environment variable.

  3. The test case is only checking if the result is an array and its length is greater than 0. It would be better to add more specific assertions to ensure the function is working as expected. For example, you could check if the length of each prompt is less than or equal to maxPromptLength.

Example:

for (const prompt of result) {
  expect(prompt.length).toBeLessThanOrEqual(maxPromptLength);
}
  1. The test case is not handling potential errors from the constructPromptsArray function. Consider adding a try-catch block to handle and assert potential errors.

Example:

try {
  const result = await constructPromptsArray(fileNames, maxPromptLength, isCi);
  // assertions
} catch (error) {
  // handle error
}

🔍🔄🧪


Powered by Code Review GPT

@github-actions
Copy link
Contributor

Test results summary:

✅ [PASS] - Test case: Bad variable name
✅ [PASS] - Test case: Exposed secret
✅ [PASS] - Test case: Too many nested loops
✅ [PASS] - Test case: Unawaited Promise

SUMMARY: ✅ PASS: 4 - ⚠️ WARN: 0 - ❌ FAIL: 0


Tests Powered by Code Review GPT

@mattzcarey mattzcarey merged commit 4734ef1 into main Jul 27, 2023
@mattzcarey mattzcarey deleted the feat/unit-test-ci branch July 27, 2023 17:28
This was referenced Aug 7, 2023
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