0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:04:16 +01:00
posthog/plugin-server/tests/config.test.ts
Michael Matloka faf75ebb5e
refactor(ingestion): Make KAFKA_ENABLED true by default and set KAFKA_HOSTS default (#9844)
* refactor(ingestion): Make `KAFKA_ENABLED` true by default

* Sync `KAFKA_HOSTS` defaults too

* Update snapshots

* Update "kafka" to "kafka:9092"

* Revert "Update "kafka" to "kafka:9092""

This reverts commit d954ac6fa6.

* Update some tests

* Revert "Revert "Update "kafka" to "kafka:9092"""

This reverts commit 07edfa6c5e.

* Update test_0004_replicated_schema.ambr

* Remove `KAFKA_ENABLED` and `KAFKA_HOSTS` from places

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-19 19:18:15 +02:00

31 lines
994 B
TypeScript

import { getDefaultConfig, overrideWithEnv } from '../src/config/config'
describe('config', () => {
test('overrideWithEnv 1', () => {
const defaultConfig = getDefaultConfig()
const env = {
CLICKHOUSE_SECURE: 'false',
TASK_TIMEOUT: '3008',
CLICKHOUSE_HOST: '0.0.0.0',
BASE_DIR: undefined,
}
const config = overrideWithEnv(getDefaultConfig(), env)
expect(config.CLICKHOUSE_SECURE).toEqual(false)
expect(config.TASK_TIMEOUT).toEqual(3008)
expect(config.CLICKHOUSE_HOST).toEqual('0.0.0.0')
expect(config.BASE_DIR).toEqual(defaultConfig.BASE_DIR)
})
test('overrideWithEnv 2', () => {
const env = {
CLICKHOUSE_SECURE: '1',
TASK_TIMEOUT: '3008.12',
}
const config = overrideWithEnv(getDefaultConfig(), env)
expect(config.CLICKHOUSE_SECURE).toEqual(true)
expect(config.TASK_TIMEOUT).toEqual(3008.12)
})
})