Skip to content

Commit c8a2426

Browse files
committed
test(useBreakpoint): fix tests
1 parent d6c2b7f commit c8a2426

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/0/src/composables/useBreakpoints/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ describe('useBreakpoints', () => {
155155
})
156156

157157
it('should register resize listener in browser environment', () => {
158+
mockGetCurrentInstance.mockReturnValue({} as any)
159+
158160
createBreakpoints()
159161

160162
expect(mockWindow.addEventListener).toHaveBeenCalledWith('resize', expect.any(Function), { passive: true })
@@ -342,6 +344,8 @@ describe('useBreakpoints', () => {
342344
})
343345

344346
it('should clean up resize listener on scope dispose', () => {
347+
mockGetCurrentInstance.mockReturnValue({} as any)
348+
345349
createBreakpoints()
346350

347351
expect(mockOnScopeDispose).toHaveBeenCalledWith(expect.any(Function))

0 commit comments

Comments
 (0)