test: cover git service with tests
This MR slightly refactors the git_service.js
. It moves all the exported functions under one GitService
class and instead of calling to vscode
APIs directly, it uses dependency injection to add all the dependencies to the constructor. This allows for easy unit testing.
And the unit testing is the main portion of the MR. This MR fully covers the git_service.js
with tests with the exception of the instanceUrl
logic added in !90 (merged) (after this MR has been created).
So this MR can be summed up into these 3 steps:
- create GitService class and inject all dependencies in the constructor.
- change all usages of
git_service.js
module to match the new API - write a unit test suite for
git_service.js
Part of #145 (closed)
Edited by Tomas Vik