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 unit test for args.ts #578

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Add unit test for args.ts #578

merged 2 commits into from
Apr 9, 2024

Conversation

manushak
Copy link
Contributor

@manushak manushak commented Apr 5, 2024

Types of changes

  • Enhancement (project structure, spelling, grammar, formatting)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

A description of the changes proposed in the Pull Request

  • add full test coverage for args.ts

describe('util/args: ', () => {
const originalEnv = process.env;

describe('parseArgs(): ', () => {
it('throws error if there is no argument passed.', () => {
expect.assertions(2);
expect.assertions(5);

process.env.result = 'error'; // used for mocking

try {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't try-catch blocks be in separate unit tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've combined all of them because the meaning is the same

@manushak manushak self-assigned this Apr 5, 2024
@MariamKhalatova MariamKhalatova merged commit 5bd07f8 into main Apr 9, 2024
2 checks passed
@MariamKhalatova MariamKhalatova deleted the args-unit-test branch April 9, 2024 10:03
This was referenced May 17, 2024
@github-actions github-actions bot mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants