Skip to content

Commit 270ce53

Browse files
committed
Fix tests
1 parent 4c74bfa commit 270ce53

File tree

1 file changed

+54
-30
lines changed

1 file changed

+54
-30
lines changed

packages/core/test/lib/integrations/inboundfilters.test.ts

+54-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventProcessor } from '@sentry/types';
1+
import { EventProcessor, Event } from '@sentry/types';
22

33
import { InboundFilters, InboundFiltersOptions } from '../../../src/integrations/inboundfilters';
44

@@ -52,50 +52,68 @@ function createInboundFiltersEventProcessor(
5252

5353
// Fixtures
5454

55-
const MESSAGE_EVENT = {
55+
const MESSAGE_EVENT: Event = {
5656
message: 'captureMessage',
5757
};
5858

59-
const MESSAGE_EVENT_2 = {
59+
const MESSAGE_EVENT_2: Event = {
6060
message: 'captureMessageSomething',
6161
};
6262

63-
const MESSAGE_EVENT_WITH_STACKTRACE = {
63+
const MESSAGE_EVENT_WITH_STACKTRACE: Event = {
6464
message: 'wat',
65-
stacktrace: {
66-
// Frames are always in the reverse order, as this is how Sentry expect them to come.
67-
// Frame that crashed is the last one, the one from awesome-analytics
68-
frames: [
69-
{ filename: 'https://our-side.com/js/bundle.js' },
70-
{ filename: 'https://our-side.com/js/bundle.js' },
71-
{ filename: 'https://awesome-analytics.io/some/file.js' },
65+
exception: {
66+
values: [
67+
{
68+
stacktrace: {
69+
// Frames are always in the reverse order, as this is how Sentry expect them to come.
70+
// Frame that crashed is the last one, the one from awesome-analytics
71+
frames: [
72+
{ filename: 'https://our-side.com/js/bundle.js' },
73+
{ filename: 'https://our-side.com/js/bundle.js' },
74+
{ filename: 'https://awesome-analytics.io/some/file.js' },
75+
],
76+
},
77+
},
7278
],
7379
},
7480
};
7581

76-
const MESSAGE_EVENT_WITH_ANON_LAST_FRAME = {
82+
const MESSAGE_EVENT_WITH_ANON_LAST_FRAME: Event = {
7783
message: 'any',
78-
stacktrace: {
79-
frames: [
80-
{ filename: 'https://our-side.com/js/bundle.js' },
81-
{ filename: 'https://awesome-analytics.io/some/file.js' },
82-
{ filename: '<anonymous>' },
84+
exception: {
85+
values: [
86+
{
87+
stacktrace: {
88+
frames: [
89+
{ filename: 'https://our-side.com/js/bundle.js' },
90+
{ filename: 'https://awesome-analytics.io/some/file.js' },
91+
{ filename: '<anonymous>' },
92+
],
93+
},
94+
},
8395
],
8496
},
8597
};
8698

87-
const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME = {
99+
const MESSAGE_EVENT_WITH_NATIVE_LAST_FRAME: Event = {
88100
message: 'any',
89-
stacktrace: {
90-
frames: [
91-
{ filename: 'https://our-side.com/js/bundle.js' },
92-
{ filename: 'https://awesome-analytics.io/some/file.js' },
93-
{ filename: '[native code]' },
101+
exception: {
102+
values: [
103+
{
104+
stacktrace: {
105+
frames: [
106+
{ filename: 'https://our-side.com/js/bundle.js' },
107+
{ filename: 'https://awesome-analytics.io/some/file.js' },
108+
{ filename: '[native code]' },
109+
],
110+
},
111+
},
94112
],
95113
},
96114
};
97115

98-
const EXCEPTION_EVENT = {
116+
const EXCEPTION_EVENT: Event = {
99117
exception: {
100118
values: [
101119
{
@@ -106,7 +124,7 @@ const EXCEPTION_EVENT = {
106124
},
107125
};
108126

109-
const EXCEPTION_EVENT_WITH_FRAMES = {
127+
const EXCEPTION_EVENT_WITH_FRAMES: Event = {
110128
exception: {
111129
values: [
112130
{
@@ -124,7 +142,7 @@ const EXCEPTION_EVENT_WITH_FRAMES = {
124142
},
125143
};
126144

127-
const SENTRY_EVENT = {
145+
const SENTRY_EVENT: Event = {
128146
exception: {
129147
values: [
130148
{
@@ -135,7 +153,7 @@ const SENTRY_EVENT = {
135153
},
136154
};
137155

138-
const SCRIPT_ERROR_EVENT = {
156+
const SCRIPT_ERROR_EVENT: Event = {
139157
exception: {
140158
values: [
141159
{
@@ -146,9 +164,15 @@ const SCRIPT_ERROR_EVENT = {
146164
},
147165
};
148166

149-
const MALFORMED_EVENT = {
150-
stacktrace: {
151-
frames: undefined,
167+
const MALFORMED_EVENT: Event = {
168+
exception: {
169+
values: [
170+
{
171+
stacktrace: {
172+
frames: undefined,
173+
},
174+
},
175+
],
152176
},
153177
};
154178

0 commit comments

Comments
 (0)