Skip to content

test: cover git service with tests

Tomas Vik requested to merge 145-tests-for-git-service into main

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:

  1. create GitService class and inject all dependencies in the constructor.
  2. change all usages of git_service.js module to match the new API
  3. write a unit test suite for git_service.js

Part of #145 (closed)

Edited by Tomas Vik

Merge request reports

Loading