1 parent 35190bc commit 44a1249Copy full SHA for 44a1249
1 file changed
frontend/src/test/setup.ts
@@ -1,10 +1,19 @@
1
import { GlobalRegistrator } from '@happy-dom/global-registrator'
2
-import { afterEach, expect } from 'bun:test'
+import { afterEach, expect, mock } from 'bun:test'
3
import * as matchers from '@testing-library/jest-dom/matchers'
4
5
GlobalRegistrator.register()
6
expect.extend(matchers as Parameters<typeof expect.extend>[0])
7
8
+mock.module('posthog-js', () => ({
9
+ default: {
10
+ init: mock(),
11
+ capture: mock(),
12
+ identify: mock(),
13
+ reset: mock(),
14
+ }
15
+}))
16
+
17
// usehooks-ts' `useLocalStorage` dispatches a custom "local-storage" event on
18
// `window` to synchronise multiple hooks of the same key within one window.
19
// Across tests, hooks from earlier tests linger (React roots aren't unmounted
0 commit comments