: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { describe, expect, test } from 'bun:test'
import { readGolden, runScenario, withoutRandomIds } from './run'
import { SCENARIOS } from './scenarios'
// Each golden is what posthog-cli sent to the fake server for the same files and flags
// (record-e2e.ts). hog must send the same requests, with the same bodies and uploaded bytes, and
// exit with the same code.
describe('hog error-tracking sends what posthog-cli sends', () => {
test.each(SCENARIOS.map((scenario) => [scenario.name, scenario] as const))('%s', async (name, scenario) => {
const golden = readGolden(name)
const result = await runScenario(scenario, 'hog')
if (scenario.randomIds) {
expect(withoutRandomIds(result)).toEqual(withoutRandomIds(golden))
} else {
expect(result).toEqual(golden)
}
})
})