stackdriver-errors-js
stackdriver-errors-js copied to clipboard
add custom window constructor
So, this PR is related to issue https://github.com/GoogleCloudPlatform/stackdriver-errors-js/issues/124 which I have opened. This PR is for whomever is interested. Hope it helps and someone will take it to review and merge :)
Regarding the tests. I know it looks awful in the diff view, but what I essentially did is: I just created another test suite which runs the same tests but with the new constructor addition. So i needed to extract the functions logic outside and use closure for some functions.
But basically this is the new structure of the tests:
Before each and after each are the same except for the instantiation of StackdriverErrorReporter and window which is done inside the tests suites itself.
first suite -> same logic
second suite -> same logic just with new StackdriverErrorReporter(customWindow)
Thanks!