0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/plugin-server/tests/cdp/utils.test.ts

15 lines
587 B
TypeScript
Raw Normal View History

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)
})
})
})