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 missing unit tests #9

Merged
merged 38 commits into from
Apr 21, 2022
Merged

Add missing unit tests #9

merged 38 commits into from
Apr 21, 2022

Conversation

matextrem
Copy link
Contributor

@matextrem matextrem commented Apr 8, 2022

This PR closes #2

  • Added missing unit tests
  • Add coveralls npm task
  • Add github action to perform coveralls task when there is a push in a pull request

@matextrem matextrem self-assigned this Apr 8, 2022
@matextrem matextrem changed the title Add Missing unit tests Add missing unit tests Apr 8, 2022
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 6 0
Ignored 0 N/A
  • Result: ✅ success

  • Annotations: 6 total


[failure] @typescript-eslint/no-explicit-any


Report generated by eslint-plus-action

@matextrem matextrem marked this pull request as ready for review April 12, 2022 21:41
@matextrem matextrem changed the title Add missing unit tests [Do not merge] Add missing unit tests Apr 12, 2022
@matextrem matextrem added the enhancement New feature or request label Apr 12, 2022
@matextrem
Copy link
Contributor Author

I'm not pretty sure why Coveralls BOT is not commenting the PR.

@matextrem matextrem changed the title [Do not merge] Add missing unit tests Add missing unit tests Apr 14, 2022
Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Left a few comments regarding individual tests

Regarding the coverage, while there are no comments published by the bot (🤷), it's not hard to find the report by looking at the PR checks

Screen Shot 2022-04-18 at 11 34 43

Looking that the current coverage of 57%, is your goal to increase that further with this or follow up PRs?

src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

We are getting there!

Apart from the code comments, I'd also add some tests to validate that the passed appDataHash on the SDK's constructor is actually set on the X-AppId header

src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
@matextrem
Copy link
Contributor Author

Left a few comments regarding individual tests

Regarding the coverage, while there are no comments published by the bot (🤷), it's not hard to find the report by looking at the PR checks

Screen Shot 2022-04-18 at 11 34 43

Looking that the current coverage of 57%, is your goal to increase that further with this or follow up PRs?

Yeah, the idea is to have our features tested as long as we can. We have reached around 90% in CowApi with this PR. We should also trying to achieve the same for the others APIs (It could be achieved in follow up PRs). Also, it is a good practice to create unit tests with new features (The PR of a new feature should include the logic and also the tests) to keep the coverage.

setupTests.js Outdated Show resolved Hide resolved
setupTests.js Outdated Show resolved Hide resolved
@matextrem matextrem requested a review from ramirotw April 18, 2022 17:58
Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

🚢

Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Nice job!

Left a few nitpicks and questions but it's approved already

src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
src/api/cow/cow.spec.ts Outdated Show resolved Hide resolved
@matextrem matextrem merged commit d1b9b06 into main Apr 21, 2022
@matextrem matextrem deleted the 2/unit-tests branch April 21, 2022 18:28
@ramirotw ramirotw mentioned this pull request Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Protofire
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing unit tests
3 participants