Skip to content

Commit

Permalink
chore: remove modifying global window
Browse files Browse the repository at this point in the history
Removing redefining the global window as Jest will fail a test with the
error:

```
TypeError: Cannot redefine property: window
```
  • Loading branch information
joelcarr committed Aug 2, 2023
1 parent 991e1f1 commit fe4cc22
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ describe('Live blog Visibility Tracker', function () {

it('should emit an error when a query is not passed to config', function () {
setupIntersectionObserverMock()
global.window = doc
global.window.addEventListener = jest.fn(() => {})
global.document = doc.window
global.document.querySelectorAll = jest.fn(() => [{}])
let spy = jest.fn(() => {})
new PostTracker({ onError: spy })
Expand Down

0 comments on commit fe4cc22

Please sign in to comment.