2026-05-22 18:18:47 +02:00
|
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
|
|
2026-05-25 13:17:46 +02:00
|
|
|
import { isDemoConnection } from '../../src/telemetry/demo-detect.js';
|
2026-05-22 18:18:47 +02:00
|
|
|
|
|
|
|
|
describe('isDemoConnection', () => {
|
|
|
|
|
it('detects only the packaged Orbit SQLite demo recipe', () => {
|
|
|
|
|
expect(
|
|
|
|
|
isDemoConnection('orbit_demo', {
|
|
|
|
|
driver: 'sqlite',
|
|
|
|
|
path: '/tmp/ktx-demo/demo.db',
|
|
|
|
|
}),
|
|
|
|
|
).toBe(true);
|
|
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
isDemoConnection('orbit_demo', {
|
|
|
|
|
driver: 'postgres',
|
|
|
|
|
path: '/tmp/ktx-demo/demo.db',
|
|
|
|
|
}),
|
|
|
|
|
).toBe(false);
|
|
|
|
|
expect(
|
|
|
|
|
isDemoConnection('warehouse', {
|
|
|
|
|
driver: 'sqlite',
|
|
|
|
|
path: '/tmp/ktx-demo/demo.db',
|
|
|
|
|
}),
|
|
|
|
|
).toBe(false);
|
|
|
|
|
expect(
|
|
|
|
|
isDemoConnection('orbit_demo', {
|
|
|
|
|
driver: 'sqlite',
|
|
|
|
|
path: '/tmp/ktx-demo/private.db',
|
|
|
|
|
}),
|
|
|
|
|
).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
});
|