Optimize relationship discovery benchmarks

This commit is contained in:
Andrey Avtomonov 2026-05-11 01:48:00 +02:00
parent 9530d33c00
commit eee46896f1
5 changed files with 83 additions and 21 deletions

View file

@ -1,4 +1,5 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import { createRequire } from 'node:module';
import { describe, it } from 'node:test';
import { buildBenchmarkSnapshot } from './build-benchmark-snapshot.mjs';
@ -250,4 +251,13 @@ describe('buildBenchmarkSnapshot', () => {
},
]);
});
it('exposes relationship benchmarks as an explicit context package script', async () => {
const packageJson = JSON.parse(await readFile(new URL('../packages/context/package.json', import.meta.url), 'utf8'));
assert.equal(
packageJson.scripts['relationships:benchmarks:test'],
'KTX_RUN_RELATIONSHIP_BENCHMARKS=1 vitest run src/scan/relationship-benchmarks.test.ts',
);
});
});