Skip to content

Commit 887a30e

Browse files
committed
🤦🏻 fix tests
1 parent 53493ae commit 887a30e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

packages/hub/src/scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class Scope implements ScopeInterface {
436436
* @param hint May contain additional information about the original exception.
437437
* @hidden
438438
*/
439-
public applyToEvent(event: Event, hint: EventHint): PromiseLike<Event | null> {
439+
public applyToEvent(event: Event, hint: EventHint = {}): PromiseLike<Event | null> {
440440
if (this._extra && Object.keys(this._extra).length) {
441441
event.extra = { ...this._extra, ...event.extra };
442442
}

packages/integrations/src/debug.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class Debug implements Integration {
3737
* @inheritDoc
3838
*/
3939
public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {
40-
addGlobalEventProcessor((event: Event, hint?: EventHint) => {
40+
addGlobalEventProcessor((event: Event, hint: EventHint) => {
4141
const self = getCurrentHub().getIntegration(Debug);
4242
if (self) {
4343
if (self._options.debugger) {
@@ -49,12 +49,12 @@ export class Debug implements Integration {
4949
consoleSandbox(() => {
5050
if (self._options.stringify) {
5151
console.log(JSON.stringify(event, null, 2));
52-
if (hint) {
52+
if (Object.keys(hint).length) {
5353
console.log(JSON.stringify(hint, null, 2));
5454
}
5555
} else {
5656
console.log(event);
57-
if (hint) {
57+
if (Object.keys(hint).length) {
5858
console.log(hint);
5959
}
6060
}

packages/integrations/src/extraerrordata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class ExtraErrorData implements Integration {
4949
/**
5050
* Attaches extracted information from the Error object to extra field in the Event
5151
*/
52-
public enhanceEventWithErrorData(event: Event, hint: EventHint): Event {
52+
public enhanceEventWithErrorData(event: Event, hint: EventHint = {}): Event {
5353
if (!hint.originalException || !isError(hint.originalException)) {
5454
return event;
5555
}

packages/integrations/test/debug.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Debug integration setup should register an event processor that', () =
2727

2828
const captureEventProcessor = (eventProcessor: EventProcessor) => {
2929
const testEvent = { event_id: 'some event' };
30-
void eventProcessor(testEvent);
30+
void eventProcessor(testEvent, {});
3131
expect(mockConsoleLog).toHaveBeenCalledTimes(1);
3232
expect(mockConsoleLog).toBeCalledWith(testEvent);
3333
};
@@ -55,7 +55,7 @@ describe('Debug integration setup should register an event processor that', () =
5555

5656
const captureEventProcessor = (eventProcessor: EventProcessor) => {
5757
const testEvent = { event_id: 'some event' };
58-
void eventProcessor(testEvent);
58+
void eventProcessor(testEvent, {});
5959
expect(mockConsoleLog).toHaveBeenCalledTimes(1);
6060
expect(mockConsoleLog).toBeCalledWith(JSON.stringify(testEvent, null, 2));
6161
};

packages/integrations/test/offline.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function processEventListeners(): void {
202202
function processEvents(): void {
203203
eventProcessors.forEach(processor => {
204204
events.forEach(event => {
205-
processor(event) as Event | null;
205+
processor(event, {}) as Event | null;
206206
});
207207
});
208208
}

packages/node/test/integrations/linkederrors.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('LinkedErrors', () => {
1919
const event = {
2020
message: 'foo',
2121
};
22-
return linkedErrors._handler(stackParser, event).then((result: any) => {
22+
return linkedErrors._handler(stackParser, event, {}).then((result: any) => {
2323
expect(spy.mock.calls.length).toEqual(0);
2424
expect(result).toEqual(event);
2525
});
@@ -36,7 +36,7 @@ describe('LinkedErrors', () => {
3636
.eventFromException(one)
3737
.then(eventFromException => {
3838
event = eventFromException;
39-
return linkedErrors._handler(stackParser, eventFromException);
39+
return linkedErrors._handler(stackParser, eventFromException, {});
4040
})
4141
.then(result => {
4242
expect(spy.mock.calls.length).toEqual(0);

0 commit comments

Comments
 (0)