Skip to content

Commit ea3887f

Browse files
committed
feat(solidjs): Move browserInit spy into testcase
1 parent 9cdc10a commit ea3887f

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

packages/astro/test/client/sdk.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ describe('Sentry client SDK', () => {
2525
getGlobalScope().clear();
2626
});
2727

28+
afterAll(() => {
29+
vi.restoreAllMocks();
30+
});
31+
2832
it('adds Astro metadata to the SDK options', () => {
2933
expect(browserInit).not.toHaveBeenCalled();
3034

packages/solidjs/test/sdk.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SDK_VERSION } from '@sentry/browser';
22
import * as SentryBrowser from '@sentry/browser';
33

4-
import { vi } from 'vitest';
4+
import { afterAll, vi } from 'vitest';
55
import { init as solidInit } from '../src/sdk';
66

77
const browserInit = vi.spyOn(SentryBrowser, 'init');
@@ -11,6 +11,10 @@ describe('Initialize SolidJS SDk', () => {
1111
vi.clearAllMocks();
1212
});
1313

14+
afterAll(() => {
15+
browserInit.mockRestore();
16+
});
17+
1418
it('has the correct metadata', () => {
1519
solidInit({
1620
dsn: 'https://[email protected]/1337',

packages/svelte/test/sdk.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ describe('Initialize Svelte SDk', () => {
2020
vi.clearAllMocks();
2121
});
2222

23+
afterAll(() => {
24+
browserInit.mockRestore();
25+
});
26+
2327
it('has the correct metadata', () => {
2428
svelteInit({
2529
dsn: 'https://[email protected]/1337',
@@ -80,6 +84,10 @@ describe('detectAndReportSvelteKit()', () => {
8084
passedEventProcessor = undefined;
8185
});
8286

87+
afterAll(() => {
88+
addEventProcessor.mockRestore();
89+
});
90+
8391
it('registers an event processor', async () => {
8492
detectAndReportSvelteKit();
8593

0 commit comments

Comments
 (0)