event.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import {type Event, EventOrGroupType, EventTransaction} from 'sentry/types';
  2. export function EventFixture(params = {}): Event {
  3. return {
  4. id: '1',
  5. message: 'ApiException',
  6. title: 'ApiException',
  7. metadata: {},
  8. entries: [],
  9. projectID: '1',
  10. groupID: '1',
  11. eventID: '12345678901234567890123456789012',
  12. dateCreated: '2019-05-21T18:01:48.762Z',
  13. dateReceived: '2019-05-21T18:01:48.762Z',
  14. tags: [],
  15. errors: [],
  16. crashFile: null,
  17. size: 0,
  18. dist: null,
  19. fingerprints: [],
  20. culprit: '',
  21. user: null,
  22. location: '',
  23. type: EventOrGroupType.ERROR,
  24. occurrence: null,
  25. resolvedWith: [],
  26. contexts: {},
  27. ...params,
  28. };
  29. }
  30. export function TransactionEventFixture(
  31. params: Partial<EventTransaction> = {}
  32. ): EventTransaction {
  33. return {
  34. type: EventOrGroupType.TRANSACTION,
  35. id: '1',
  36. message: '',
  37. crashFile: null,
  38. culprit: '',
  39. dateCreated: '2023-12-28T15:58:48.762Z',
  40. dist: '',
  41. errors: [],
  42. occurrence: null,
  43. dateReceived: '2023-12-28T15:58:48.762Z',
  44. size: 0,
  45. user: null,
  46. title: '',
  47. metadata: {},
  48. entries: [],
  49. projectID: '1',
  50. groupID: '1',
  51. eventID: '47829ecde95d42ac843f24592b7b7e46',
  52. tags: [],
  53. endTimestamp: 1703779100,
  54. startTimestamp: 1703779101,
  55. fingerprints: [],
  56. location: '',
  57. contexts: {},
  58. ...params,
  59. };
  60. }