Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

867 B
Raw Blame
import { expect, test } from 'bun:test';
import { TEST_CLICKHOUSE_URL } from '../../../test/databases';

// The exports map is the only structural barrier between apps/start and a
// service. Widening it is silent, so it is asserted here.
test('the curated barrel resolves', async () => {
  expect(await import('@openpanel/core')).toBeDefined();
});

test('a non-exported internal path does not resolve', async () => {
  // @ts-expect-error not in the exports map, by design
  const attempt = import('@openpanel/core/context');
  await expect(attempt).rejects.toThrow(/Cannot find/);
});

test('preload pins infrastructure at local addresses', () => {
  expect(process.env.CLICKHOUSE_URL).toBe(TEST_CLICKHOUSE_URL);
  expect(process.env.CLICKHOUSE_URL).toStartWith(
    'http://localhost:23123/openpanel_test'
  );
  expect(process.env.SELF_HOSTED).toBe('true');
});