Skip to content

Commit 36df344

Browse files
committed
Add mocks.
1 parent b342218 commit 36df344

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

browser-extension/tests/har-fixture.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { vi } from 'vitest'
22

3+
// Mock MutationObserver for tests
4+
global.MutationObserver = vi.fn().mockImplementation(() => ({
5+
disconnect: vi.fn(),
6+
observe: vi.fn(),
7+
takeRecords: vi.fn(() => []),
8+
}))
9+
310
// Mock the OverType editor component
411
vi.mock('overtype', () => {
512
const mockConstructor = vi.fn().mockImplementation(() => [
@@ -15,6 +22,7 @@ vi.mock('overtype', () => {
1522
},
1623
])
1724
;(mockConstructor as any).setCodeHighlighter = vi.fn()
25+
;(mockConstructor as any).setTheme = vi.fn()
1826
return {
1927
default: mockConstructor,
2028
}

0 commit comments

Comments
 (0)