eventEntry.ts 777 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {ImageFixture} from 'sentry-fixture/image';
  2. import {
  3. type Entry,
  4. type EntryDebugMeta,
  5. type EntryRequest,
  6. EntryType,
  7. } from 'sentry/types';
  8. export function EventEntryFixture(params = {}): Entry {
  9. return {
  10. type: EntryType.MESSAGE,
  11. data: {
  12. formatted: 'Blocked script',
  13. },
  14. ...params,
  15. };
  16. }
  17. export function EntryRequestFixture(params: Partial<EntryRequest> = {}): EntryRequest {
  18. return {
  19. type: EntryType.REQUEST,
  20. data: {
  21. apiTarget: null,
  22. method: 'GET',
  23. url: '/index',
  24. },
  25. ...params,
  26. };
  27. }
  28. export function EntryDebugMetaFixture(
  29. params: Partial<EntryDebugMeta> = {}
  30. ): EntryDebugMeta {
  31. return {
  32. type: EntryType.DEBUGMETA,
  33. data: {
  34. images: [ImageFixture()],
  35. },
  36. ...params,
  37. };
  38. }