0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 00:46:45 +01:00
posthog/plugin-server/tests/cdp/utils.test.ts
2024-07-26 11:03:15 +00:00

15 lines
587 B
TypeScript

import { gzipObject, unGzipObject } from '../../src/cdp/utils'
import { insertHogFunction as _insertHogFunction } from './fixtures'
describe('Utils', () => {
describe('gzip compressions', () => {
it("should compress and decompress a string using gzip's sync functions", async () => {
const input = { foo: 'bar', foo2: 'bar' }
const compressed = await gzipObject(input)
expect(compressed).toHaveLength(52)
const decompressed = await unGzipObject(compressed)
expect(decompressed).toEqual(input)
})
})
})