Skip to content

Commit 850eb06

Browse files
fix client test
1 parent 7df528a commit 850eb06

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/nextjs/src/performance/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import { Primitive, Transaction, TransactionContext } from '@sentry/types';
44
import { fill, getGlobalObject, stripUrlQueryAndFragment } from '@sentry/utils';
5-
import { default as Router } from 'next/router';
5+
6+
import { Router } from '../../src/utils/nextImporter';
67

78
const global = getGlobalObject<Window>();
89

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { default as DefaultRouter } from 'next/router';
2+
3+
export const Router = DefaultRouter.default ?? DefaultRouter;

packages/nextjs/test/performance/client.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { default as Router } from 'next/router';
2-
31
import { nextRouterInstrumentation } from '../../src/performance/client';
2+
import { Router } from '../../src/utils/nextImporter';
43

54
let readyCalled = false;
65
jest.mock('next/router', () => {

0 commit comments

Comments
 (0)