Now that we're relying more and more on GitForWindowsHelper, it is becoming more and more risky that we deploy without really having any way to test automatically, other than the (admittedly excellent) linting facilities provided by ESLint.
Since GitForWindowsHelper is not written in Typescript, but instead in pure JavaScript, things should be slightly easier over here. Off the top of my head, we will need to:
Use mock functions (see also here) to intercept GitHub REST API calls, validate that they were called with the expected parameters, and return mock return values (most likely storing real webhook event payloads that were actually received, as files that are then parsed into a context object much like we do in our manual test.
Now that we're relying more and more on GitForWindowsHelper, it is becoming more and more risky that we deploy without really having any way to test automatically, other than the (admittedly excellent) linting facilities provided by ESLint.
Let's add a Jest-based test suite, much like GitGitGadget has.
Since GitForWindowsHelper is not written in Typescript, but instead in pure JavaScript, things should be slightly easier over here. Off the top of my head, we will need to:
npm install --save-dev jest
npm run test
__tests__/
context
object much like we do in our manual test.