Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

3.9 KB
Raw Blame
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`NativeDestinationExecutorService native plugins should call the plugin perform method 1`] = `
[
  {
    "level": "debug",
    "message": "config, {"url":"https://posthog.com/webhook","method":"POST","body":{"event_name":"$pageview"},"headers":{"Authorization":"***REDACTED***"},"debug_mode":true,"connection":{"$integration_id":1,"password":"***REDACTED***"}}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "endpoint, https://posthog.com/webhook",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "options, {"method":"POST","headers":{"Authorization":"***REDACTED***"},"json":{"event_name":"$pageview"}}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "fetchOptions, {"method":"POST","headers":{"User-Agent":"PostHog.com/1.0","Authorization":"***REDACTED***","Content-Type":"application/json"},"body":"{\\"event_name\\":\\"$pageview\\"}"}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "convertedResponse, 200, {"code":200,"server_upload_time":1747910402315,"payload_size_bytes":22207,"events_ingested":1}, {"code":200,"server_upload_time":1747910402315,"payload_size_bytes":22207,"events_ingested":1}, {}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "info",
    "message": "Function completed in [REPLACED]",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
]
`;

exports[`NativeDestinationExecutorService native plugins should handle non retryable fetch errors 1`] = `
[
  {
    "level": "debug",
    "message": "config, {"url":"https://posthog.com/webhook","method":"POST","body":{"event_name":"$pageview"},"headers":{"Authorization":"***REDACTED***"},"debug_mode":true}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "endpoint, https://posthog.com/webhook",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "options, {"method":"POST","headers":{"Authorization":"***REDACTED***"},"json":{"event_name":"$pageview"}}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "fetchOptions, {"method":"POST","headers":{"User-Agent":"PostHog.com/1.0","Authorization":"***REDACTED***","Content-Type":"application/json"},"body":"{\\"event_name\\":\\"$pageview\\"}"}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "warn",
    "message": "HTTP request failed with status 403 ({"error":"Forbidden"}). ",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "error",
    "message": "Function failed: Error executing function on event uuid: Request failed with status 403 ({"error":"Forbidden"})",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
]
`;

exports[`NativeDestinationExecutorService native plugins should retry retryable fetch errors 1`] = `
[
  {
    "level": "debug",
    "message": "config, {"url":"https://posthog.com/webhook","method":"POST","body":{"event_name":"$pageview"},"headers":{"Authorization":"***REDACTED***"},"debug_mode":true}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "endpoint, https://posthog.com/webhook",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "options, {"method":"POST","headers":{"Authorization":"***REDACTED***"},"json":{"event_name":"$pageview"}}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "debug",
    "message": "fetchOptions, {"method":"POST","headers":{"User-Agent":"PostHog.com/1.0","Authorization":"***REDACTED***","Content-Type":"application/json"},"body":"{\\"event_name\\":\\"$pageview\\"}"}",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
  {
    "level": "warn",
    "message": "HTTP request failed with status 429 ({"error":"Too many requests"}). Scheduling retry...",
    "timestamp": "2025-01-01T00:00:00.000Z",
  },
]
`;