Skip to content

Commit b37c594

Browse files
committed
fix types & test
1 parent ca34264 commit b37c594

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
77
sentryTest(
88
'Instrumentation does not fail when using frozen callback for setTimeout',
99
async ({ getLocalTestPath, page }) => {
10+
const bundleKey = process.env.PW_BUNDLE || '';
11+
const hasDebug = !bundleKey.includes('_min');
12+
1013
const url = await getLocalTestPath({ testDir: __dirname });
1114

1215
const logMessages: string[] = [];
@@ -31,12 +34,15 @@ sentryTest(
3134
},
3235
});
3336

34-
expect(logMessages).toEqual(
35-
expect.arrayContaining([
36-
expect.stringContaining(
37-
'Sentry Logger [log]: Failed to add non-enumerable property "__sentry_wrapped__" to object function callback()',
38-
),
39-
]),
40-
);
37+
// We only care about the message when debug is enabled
38+
if (hasDebug) {
39+
expect(logMessages).toEqual(
40+
expect.arrayContaining([
41+
expect.stringContaining(
42+
'Sentry Logger [log]: Failed to add non-enumerable property "__sentry_wrapped__" to object function callback()',
43+
),
44+
]),
45+
);
46+
}
4147
},
4248
);

packages/browser/test/unit/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getReportDialogEndpoint, SDK_VERSION } from '@sentry/core';
2-
import { WrappedFunction } from '@sentry/types';
2+
import type { WrappedFunction } from '@sentry/types';
33
import * as utils from '@sentry/utils';
44

55
import type { Event } from '../../src';

packages/utils/test/object.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
* @jest-environment jsdom
33
*/
44

5-
import { WrappedFunction } from '@sentry/types';
5+
import type { WrappedFunction } from '@sentry/types';
6+
67
import {
8+
addNonEnumerableProperty,
79
dropUndefinedKeys,
810
extractExceptionKeysForMessage,
911
fill,
12+
markFunctionWrapped,
1013
objectify,
1114
urlEncode,
12-
addNonEnumerableProperty,
13-
markFunctionWrapped,
1415
} from '../src/object';
1516
import { testOnlyIfNodeVersionAtLeast } from './testutils';
1617

0 commit comments

Comments
 (0)