Skip to content

Commit

Permalink
test: 🧪 test correlation property in delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbenw committed Jul 23, 2024
1 parent 3b03417 commit d15e41d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/delivery-react-native/test/delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type NativeClientEvent = Pick<EventWithInternals,
severityReason: EventWithInternals['_handledState']['severityReason']
user: EventWithInternals['_user']
metadata: EventWithInternals['_metadata']
correlation: EventWithInternals['_correlation']
nativeStack: NativeStackIOS | NativeStackAndroid
}

Expand Down Expand Up @@ -57,6 +58,7 @@ describe('delivery: react native', () => {
c.setContext('test screen')
c.setUser('123')
c.notify(new Error('oh no'), (e) => {
e.setTraceCorrelation('trace-id', 'span-id')
e.groupingHash = 'ER_GRP_098'
e.apiKey = 'abcdef123456abcdef123456abcdef123456'
}, (err, event) => {
Expand All @@ -80,6 +82,7 @@ describe('delivery: react native', () => {
expect(sent[0].metadata).toEqual({})
expect(sent[0].groupingHash).toEqual('ER_GRP_098')
expect(sent[0].apiKey).toBe('abcdef123456abcdef123456abcdef123456')
expect(sent[0].correlation).toEqual({ traceId: 'trace-id', spanId: 'span-id' })
done()
})
})
Expand Down

0 comments on commit d15e41d

Please sign in to comment.