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

Improve Ocean class tests #198

Merged
merged 7 commits into from
Jan 5, 2024
Merged

Improve Ocean class tests #198

merged 7 commits into from
Jan 5, 2024

Conversation

mariacarmina
Copy link
Member

Fixes #158 .

Changes proposed in this PR:

  • added getter methods where needed
  • fix unit tests for Ocean class

package.json Outdated Show resolved Hide resolved
src/components/Indexer/index.ts Show resolved Hide resolved
Copy link
Contributor

@paulo-ocean paulo-ocean left a comment

Choose a reason for hiding this comment

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

overall , LGTM. i don´t have any issues with having extra getters here and there :-) but i think that we should think about removing these individual tests (including unit:storage), its getting too big and we can always run the command manually,
That said, i think these tests are pretty much useless to be honest :-)
If we want to keep them its ok, but they are not really testing anything;
We create one config object, pass it in the constructor to a bunch of different objects and then check if the properties match?? But of course they match, its the same object...
It like adding 1 + 1 and checking if its 2 :-)
I'm not saying they are wrong, but i don't see any added value

@mariacarmina
Copy link
Member Author

overall , LGTM. i don´t have any issues with having extra getters here and there :-) but i think that we should think about removing these individual tests (including unit:storage), its getting too big and we can always run the command manually, That said, i think these tests are pretty much useless to be honest :-) If we want to keep them its ok, but they are not really testing anything; We create one config object, pass it in the constructor to a bunch of different objects and then check if the properties match?? But of course they match, its the same object... It like adding 1 + 1 and checking if its 2 :-) I'm not saying they are wrong, but i don't see any added value

I can remove the scripts for package.json, because I understood the reason to not populate useless with scripts and I'll remove them. For testing I wanted to test that the components were initialized correctly (and wanted to access some fields). The issue mentioned that we should have individual/granular test for OceanIndexer, OceanP2P and OceanProvider. If you have any suggestions regarding the assert statements, I am happy to add those.
Thank you @paulo-ocean for review!

@mariacarmina mariacarmina merged commit ae23765 into develop Jan 5, 2024
6 checks passed
@mariacarmina mariacarmina deleted the improve-ocean-node-tests branch January 5, 2024 14:01
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.

3 participants