stackdriver-errors-js icon indicating copy to clipboard operation
stackdriver-errors-js copied to clipboard

add custom window constructor

Open idanrozin opened this issue 2 years ago • 0 comments

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!

idanrozin avatar Dec 31 '22 12:12 idanrozin