fix(stats): harden vocabulary rollups

This commit is contained in:
2026-08-16 00:21:49 -07:00
parent 65911474cf
commit d220055b99
12 changed files with 311 additions and 44 deletions
@@ -49,3 +49,19 @@ test('vocabulary summary worker module resolves in the current layout', () => {
assert.ok(workerPath, 'expected the vocabulary summary worker module to resolve');
assert.ok(workerPath.endsWith(__filename.endsWith('.ts') ? '.ts' : '.js'));
});
test('vocabulary summary worker never falls back to the caller thread', async () => {
const runtime = new VocabularySummaryWorkerRuntime({
resolveWorkerPath: () => null,
warn: () => {},
});
try {
await assert.rejects(
runtime.run('/tmp/subminer-summary-worker-not-used.sqlite', null),
/worker unavailable/i,
);
} finally {
runtime.destroy();
}
});