mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-13 11:22:11 +02:00
Initial open-source release
This commit is contained in:
commit
1a42152e6f
1199 changed files with 257054 additions and 0 deletions
31
packages/cli/src/demo-scan.test.ts
Normal file
31
packages/cli/src/demo-scan.test.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { rm } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import { findLatestDemoScanReport, runDemoScan } from './demo-scan.js';
|
||||
|
||||
describe('demo scan helpers', () => {
|
||||
const projectDir = join(tmpdir(), `klo-demo-scan-${process.pid}`);
|
||||
|
||||
afterEach(async () => {
|
||||
await rm(projectDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it('runs the packaged SQLite demo scan and finds the latest scan report', async () => {
|
||||
const { result } = await runDemoScan({
|
||||
projectDir,
|
||||
jobId: 'demo-scan-test',
|
||||
now: () => new Date('2026-05-06T10:00:00.000Z'),
|
||||
});
|
||||
|
||||
expect(result.report).toMatchObject({
|
||||
connectionId: 'orbit_demo',
|
||||
driver: 'sqlite',
|
||||
runId: 'demo-scan-test',
|
||||
mode: 'structural',
|
||||
dryRun: false,
|
||||
});
|
||||
expect(result.report.artifactPaths.reportPath).toContain('raw-sources/orbit_demo/live-database/');
|
||||
await expect(findLatestDemoScanReport(projectDir)).resolves.toMatchObject({ runId: 'demo-scan-test' });
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue