-
Notifications
You must be signed in to change notification settings - Fork 58
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
Integrate gitbeaker API into client codebase #830
Integrate gitbeaker API into client codebase #830
Conversation
…ture/distributed-demo
…ture/distributed-demo
@VanessaScherma you could do dependency injection. To be precise, give an instance of Gitlab to DigitalTwin class via constructor. Then mocking it becomes easier. You just need to implement skeleton functionality of Gitlab to test DigitalTwin class. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/distributed-demo #830 +/- ##
=============================================================
+ Coverage 66.49% 85.93% +19.43%
=============================================================
Files 31 35 +4
Lines 394 519 +125
Branches 26 40 +14
=============================================================
+ Hits 262 446 +184
+ Misses 117 49 -68
- Partials 15 24 +9
... and 6 files with indirect coverage changes
|
The commands to run the gitlabDriver file are:
The correct functioning of the API will be visible in the terminal. |
@VanessaScherma import GitlabInstance from './gitlab.js';
import DigitalTwin from './gitlabDigitalTwin.js'; |
The updated commands are:
The only errors that npx tsc gives are related to other files, but it still works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VanessaScherma please see the suggested changes. I've made some improvements to code and pushed them to pr-830 of my fork. Please update your PR accordingly. Thanks.
…ture/distributed-demo
… feature/distributed-demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this change
@VanessaScherma |
Code Climate has analyzed commit d54bbb8 and detected 0 issues on this pull request. View more on Code Climate. |
- Uses gitbeaker API to showcase gitlab API integration into react client codebase - This PR builds on top of PR #830
merged via PR #894 |
The problem is that mockGitlabConstructor is instantiated as an empty constructor, without its methods. For example, when using this.api.Projects.search() in the code, mockGitlabConstructor is used in the test but gives an error as the methods like Projects.search() are not inserted inside the mockGitlabConstructor.
I have tried to find more information on the Internet but have not yet been able to solve it.
Thank you for your help.